Git initial commit

This commit is contained in:
lhahn committed 2023-09-17 10:56:05 +02:00
commit d631ccc7bc
12 files changed
+497

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
---
- name: install coturn server
apt:
update_cache: yes
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
pkg:
- "coturn"
- name: setup coturn cert folder
file:
state: directory
owner: turnserver
group: root
mode: 0770
path: "{{ cloud_apps }}/coturn/"
- name: enable coturn server
lineinfile:
path: "/etc/default/coturn"
regexp: '^#?TURNSERVER_ENABLED='
line: "TURNSERVER_ENABLED=1"
notify: restart coturn
- name: enable coturn server
lineinfile:
path: "/etc/turnserver.conf"
regexp: '^#?{{ configline.split("=")[0] }}{% if configline.split("=") | length > 1 %}={% endif %}'
line: "{{ configline }}"
loop: "{{ coturn_configs }}"
loop_control:
loop_var: configline
label: "{{ configline }}"
notify: restart coturn
- name: set coturn capabilities for port setting
capabilities:
path: /usr/bin/turnserver
capability: cap_net_bind_service=+ep
state: present
+32
View File
@@ -0,0 +1,32 @@
---
- name: install janus
apt:
update_cache: yes
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
pkg: janus
- name: configure janus server
lineinfile:
path: "/etc/janus/janus.jcfg"
regexp: '^\s*#?{{ configline.split("=")[0] }}{% if configline.split("=") | length > 1 %}={% endif %}'
line: " {{ configline }}"
loop: "{{ signaling_janus_configs }}"
loop_control:
loop_var: configline
label: '{{ configline.split("=")[0] }}'
notify: restart janus
- name: configure janus network
lineinfile:
path: "/etc/janus/janus.transport.http.jcfg"
regexp: '^\s*#?interface ='
line: ' interface = "lo"'
notify: restart janus
- name: configure janus network
lineinfile:
path: "/etc/janus/janus.transport.websockets.jcfg"
regexp: '^\s*#?ws_interface ='
line: ' ws_interface = "lo"'
notify: restart janus
Executable
+66
View File
@@ -0,0 +1,66 @@
---
- name: setup signaling group
group:
name: "{{ sggrp }}"
state: "present"
- name: setup signaling user
user:
name: "{{ sgusr }}"
group: "{{ sggrp }}"
groups:
- "{{ sggrp }}"
comment: Virtual Signaling User
shell: /sbin/nologin
state: present
- name: install requirements for signaling
apt:
update_cache: yes
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
pkg:
- make
- golang-go
- libsrtp2-1
- protobuf-compiler
- name: clone signaling server
git:
repo: https://github.com/strukturag/nextcloud-spreed-signaling.git
dest: "{{ cloud_apps }}/signaling-server"
notify: restart signaling
register: clone_signaling
- name: build signaling server
make:
chdir: "{{ cloud_apps }}/signaling-server"
target: build
when: clone_signaling.changed
- name: configure signaling server
template:
src: "app/signaling-server/server.conf.j2"
dest: "{{ cloud_apps }}/signaling-server/server.conf"
owner: "{{ sgusr }}"
group: "{{ sggrp }}"
mode: "o="
notify: restart signaling
- include_tasks: janus.yml
- include_tasks: nats.yml
- include_tasks: coturn.yml
- name: setup signaling systemd service unit
template:
src: "etc/systemd/system/signaling.service.j2"
dest: "/etc/systemd/system/signaling.service"
- name: enable signaling systemd unit
systemd:
name: signaling
enabled: yes
daemon_reload: yes
state: started
Executable
+14
View File
@@ -0,0 +1,14 @@
---
- name: pull nats docker image
docker_image:
name: "nats:latest"
source: pull
- name: run docker container
docker_container:
name: NATSSERVER
image: "nats:latest"
state: started
ports:
- 4222:4222
restart_policy: always