Delete Install_recording.yml1
This commit is contained in:
@@ -1,183 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Install Firefox, Geckodriver, en Nextcloud Talk Recording server
|
|
||||||
hosts: all
|
|
||||||
become: yes
|
|
||||||
vars:
|
|
||||||
firefox_url: "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US"
|
|
||||||
geckodriver_version: "v0.36.0"
|
|
||||||
geckodriver_url: "https://github.com/mozilla/geckodriver/releases/download/v0.36.0/geckodriver-v0.36.0-linux64.tar.gz"
|
|
||||||
recording_dir: "/opt/recording"
|
|
||||||
server_conf_path: "/opt/recording/server.conf"
|
|
||||||
nextcloud_domain: "{{ nextcloud_domain }}"
|
|
||||||
nextcloud_secret: "{{ nextcloud_secret }}"
|
|
||||||
signaling_url: "{{ signaling_domain }}"
|
|
||||||
signaling_internal_secret: "{{ signaling_secret }}"
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
|
|
||||||
- name: Maak map /opt aan (indien niet aanwezig)
|
|
||||||
file:
|
|
||||||
path: /opt
|
|
||||||
state: directory
|
|
||||||
|
|
||||||
- name: Download Firefox archive
|
|
||||||
get_url:
|
|
||||||
url: "{{ firefox_url }}"
|
|
||||||
dest: /opt/firefox.tar.xz
|
|
||||||
mode: '0644'
|
|
||||||
|
|
||||||
- name: Extract Firefox archive
|
|
||||||
unarchive:
|
|
||||||
src: /opt/firefox.tar.xz
|
|
||||||
dest: /opt/
|
|
||||||
remote_src: yes
|
|
||||||
extra_opts: [--strip-components=1]
|
|
||||||
args:
|
|
||||||
creates: /opt/firefox/firefox
|
|
||||||
|
|
||||||
- name: Maak symlink naar firefox in /usr/local/bin
|
|
||||||
file:
|
|
||||||
src: /opt/firefox/firefox
|
|
||||||
dest: /usr/local/bin/firefox
|
|
||||||
state: link
|
|
||||||
force: yes
|
|
||||||
|
|
||||||
- name: Update apt cache
|
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
|
|
||||||
- name: Installeer benodigde GTK bibliotheken en dependencies
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- libgtk-3-0
|
|
||||||
- libdbus-glib-1-2
|
|
||||||
- python3.10-venv
|
|
||||||
- libpulse0
|
|
||||||
- pulseaudio
|
|
||||||
- xvfb
|
|
||||||
- ffmpeg
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Download Geckodriver tarball
|
|
||||||
get_url:
|
|
||||||
url: "{{ geckodriver_url }}"
|
|
||||||
dest: /usr/local/bin/geckodriver.tar.gz
|
|
||||||
mode: '0644'
|
|
||||||
|
|
||||||
- name: Extract Geckodriver
|
|
||||||
unarchive:
|
|
||||||
src: /usr/local/bin/geckodriver.tar.gz
|
|
||||||
dest: /usr/local/bin/
|
|
||||||
remote_src: yes
|
|
||||||
extra_opts: [--strip-components=1]
|
|
||||||
args:
|
|
||||||
creates: /usr/local/bin/geckodriver
|
|
||||||
|
|
||||||
- name: Geef execute permissies aan geckodriver
|
|
||||||
file:
|
|
||||||
path: /usr/local/bin/geckodriver
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Verwijder geckodriver tarball
|
|
||||||
file:
|
|
||||||
path: /usr/local/bin/geckodriver.tar.gz
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Maak map recording aan
|
|
||||||
file:
|
|
||||||
path: "{{ recording_dir }}"
|
|
||||||
state: directory
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Maak Python virtuele omgeving aan in recording map
|
|
||||||
command: python3 -m venv venv
|
|
||||||
args:
|
|
||||||
chdir: "{{ recording_dir }}"
|
|
||||||
creates: "{{ recording_dir }}/venv/bin/activate"
|
|
||||||
|
|
||||||
- name: Installeer nextcloud-talk-recording in de virtuele omgeving
|
|
||||||
pip:
|
|
||||||
chdir: "{{ recording_dir }}"
|
|
||||||
virtualenv: "{{ recording_dir }}/venv"
|
|
||||||
requirements: "{{ recording_dir }}/requirements.txt"
|
|
||||||
ignore_errors: yes
|
|
||||||
# We gaan een work-around doen hieronder, want jij wilde pip install file://$(pwd)/nextcloud-talk-recording
|
|
||||||
# Die package moet lokaal staan, dus ik voeg een taak toe die dat pakket kopieert als je dat hebt.
|
|
||||||
|
|
||||||
- name: Kopieer nextcloud-talk-recording pakket naar recording map (optioneel, pas aan indien nodig)
|
|
||||||
copy:
|
|
||||||
src: ./nextcloud-talk-recording
|
|
||||||
dest: "{{ recording_dir }}/nextcloud-talk-recording"
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: Installeer nextcloud-talk-recording vanuit lokale map in venv
|
|
||||||
pip:
|
|
||||||
virtualenv: "{{ recording_dir }}/venv"
|
|
||||||
chdir: "{{ recording_dir }}"
|
|
||||||
name: "file://{{ recording_dir }}/nextcloud-talk-recording"
|
|
||||||
when: "'nextcloud-talk-recording' in lookup('fileglob', '{{ recording_dir }}/nextcloud-talk-recording', errors='ignore')"
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: Maak server.conf aan met juiste inhoud
|
|
||||||
copy:
|
|
||||||
dest: "{{ server_conf_path }}"
|
|
||||||
content: |
|
|
||||||
[logs]
|
|
||||||
level = 20
|
|
||||||
[http]
|
|
||||||
listen = 0.0.0.0:8000
|
|
||||||
[app]
|
|
||||||
trustedproxies =
|
|
||||||
[backend]
|
|
||||||
backends = backend-1
|
|
||||||
[backend-1]
|
|
||||||
url = {{ nextcloud_domain }}
|
|
||||||
secret = {{ nextcloud_secret }}
|
|
||||||
allowall = false
|
|
||||||
skipverify = false
|
|
||||||
maxmessagesize = 1024
|
|
||||||
videowidth = 1920
|
|
||||||
videoheight = 1080
|
|
||||||
directory = /tmp
|
|
||||||
[signaling]
|
|
||||||
url = {{ signaling_url }}
|
|
||||||
internalsecret = {{ signaling_internal_secret }}
|
|
||||||
[ffmpeg]
|
|
||||||
common = ffmpeg -loglevel level+warning -n -thread_queue_size 1024
|
|
||||||
outputaudio = -c:a libopus
|
|
||||||
outputvideo = -c:v libvpx -deadline:v realtime -crf 10 -b:v 1M
|
|
||||||
extensionaudio = .ogg
|
|
||||||
extensionvideo = .webm
|
|
||||||
[recording]
|
|
||||||
browser = firefox
|
|
||||||
[stats]
|
|
||||||
allowed_ips =
|
|
||||||
|
|
||||||
- name: Maak systemd service file voor recording server
|
|
||||||
copy:
|
|
||||||
dest: /etc/systemd/system/nextcloud-talk-recording.service
|
|
||||||
content: |
|
|
||||||
[Unit]
|
|
||||||
Description=Nextcloud Talk Recording Server
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=root
|
|
||||||
WorkingDirectory={{ recording_dir }}
|
|
||||||
ExecStart={{ recording_dir }}/venv/bin/python3 -m nextcloud.talk.recording
|
|
||||||
Restart=always
|
|
||||||
RestartSec=10
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
|
|
||||||
- name: Herlaad systemd daemon
|
|
||||||
systemd:
|
|
||||||
daemon_reload: yes
|
|
||||||
|
|
||||||
- name: Start en activeer Nextcloud Talk Recording service
|
|
||||||
systemd:
|
|
||||||
name: nextcloud-talk-recording.service
|
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
Reference in New Issue
Block a user