166 lines
4.5 KiB
YAML
166 lines
4.5 KiB
YAML
---
|
|
- name: Playbook om Firefox, Geckodriver en andere tools te installeren
|
|
hosts: localhost
|
|
become: yes
|
|
vars:
|
|
nextcloud_domain: "{{ nextcloud_domain }}"
|
|
nextcloud_secret: "{{ nextcloud_secret }}"
|
|
signaling_domain: "{{ signaling_domain }}"
|
|
signaling_secret: "{{ signaling_secret }}"
|
|
|
|
tasks:
|
|
|
|
- name: Download en extract Firefox naar /opt
|
|
ansible.builtin.command:
|
|
cmd: 'wget -O firefox.tar.xz https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US'
|
|
chdir: /opt
|
|
args:
|
|
creates: /opt/firefox
|
|
become: yes
|
|
|
|
- name: Extract Firefox
|
|
unarchive:
|
|
src: /opt/firefox.tar.xz
|
|
dest: /opt
|
|
remote_src: yes
|
|
|
|
- name: Maak een symlink voor Firefox
|
|
ansible.builtin.file:
|
|
src: /opt/firefox/firefox
|
|
dest: /usr/local/bin/firefox
|
|
state: link
|
|
become: yes
|
|
|
|
- name: Installeer benodigde GTK bibliotheken
|
|
apt:
|
|
update_cache: yes
|
|
name:
|
|
- libgtk-3-0
|
|
- libdbus-glib-1-2
|
|
become: yes
|
|
|
|
- name: Download en extract Geckodriver naar /usr/local/bin
|
|
ansible.builtin.command:
|
|
cmd: 'wget https://github.com/mozilla/geckodriver/releases/download/v0.36.0/geckodriver-v0.36.0-linux64.tar.gz'
|
|
chdir: /usr/local/bin
|
|
args:
|
|
creates: /usr/local/bin/geckodriver
|
|
become: yes
|
|
|
|
- name: Extract Geckodriver
|
|
unarchive:
|
|
src: /usr/local/bin/geckodriver-v0.36.0-linux64.tar.gz
|
|
dest: /usr/local/bin
|
|
remote_src: yes
|
|
|
|
- name: Maak Geckodriver executable
|
|
file:
|
|
path: /usr/local/bin/geckodriver
|
|
mode: '0755'
|
|
become: yes
|
|
|
|
- name: Verwijder Geckodriver tar.gz
|
|
ansible.builtin.file:
|
|
path: /usr/local/bin/geckodriver-v0.36.0-linux64.tar.gz
|
|
state: absent
|
|
become: yes
|
|
|
|
- name: Installeer python3.10-venv
|
|
apt:
|
|
update_cache: yes
|
|
name: python3.10-venv
|
|
become: yes
|
|
|
|
- name: Installeer libpulse0
|
|
apt:
|
|
update_cache: yes
|
|
name: libpulse0
|
|
become: yes
|
|
|
|
- name: Installeer pulseaudio
|
|
apt:
|
|
update_cache: yes
|
|
name: pulseaudio
|
|
become: yes
|
|
|
|
- name: Installeer xvfb
|
|
apt:
|
|
update_cache: yes
|
|
name: xvfb
|
|
become: yes
|
|
|
|
- name: Installeer ffmpeg
|
|
apt:
|
|
update_cache: yes
|
|
name: ffmpeg
|
|
become: yes
|
|
|
|
- name: Maak de map recording aan
|
|
ansible.builtin.file:
|
|
path: /home/ubuntu/recording
|
|
state: directory
|
|
become: yes
|
|
|
|
- name: Clone nextcloud-talk-recording repository
|
|
ansible.builtin.git:
|
|
repo: https://github.com/nextcloud/nextcloud-talk-recording.git
|
|
dest: /home/ubuntu/recording/nextcloud-talk-recording
|
|
become: yes
|
|
|
|
- name: Installeer een virtuele omgeving in map recording
|
|
ansible.builtin.command:
|
|
cmd: python3 -m venv venv
|
|
chdir: /home/ubuntu/recording
|
|
become: yes
|
|
|
|
- name: Activeer de virtuele omgeving en installeer nextcloud-talk-recording
|
|
ansible.builtin.shell: |
|
|
source /home/ubuntu/recording/venv/bin/activate
|
|
pip install file:///home/ubuntu/recording/nextcloud-talk-recording
|
|
args:
|
|
executable: /bin/bash
|
|
become: yes
|
|
|
|
- name: Maak de server.conf aan
|
|
ansible.builtin.copy:
|
|
dest: /home/ubuntu/recording/server.conf
|
|
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_domain }}
|
|
internalsecret = {{ signaling_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: Laat de service altijd draaien
|
|
ansible.builtin.shell: |
|
|
source /home/ubuntu/recording/venv/bin/activate
|
|
nohup python3 -m nextcloud.talk.recording > /home/ubuntu/recording/output.log 2>&1 &
|
|
args:
|
|
executable: /bin/bash
|
|
become: yes
|