134 lines
4.0 KiB
YAML
134 lines
4.0 KiB
YAML
- name: Playbook om Firefox, Geckodriver en andere tools te installeren
|
|
hosts: localhost
|
|
become: true
|
|
vars:
|
|
nextcloud_domain: "{{ nextcloud_domain }}"
|
|
nextcloud_secret: "{{ nextcloud_secret }}"
|
|
signaling_domain: "{{ signaling_domain }}"
|
|
signaling_secret: "{{ signaling_secret }}"
|
|
|
|
tasks:
|
|
|
|
- name: Download Firefox
|
|
ansible.builtin.get_url:
|
|
url: "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US"
|
|
dest: /opt/firefox.tar.xz
|
|
mode: '0644'
|
|
|
|
- name: Extract Firefox
|
|
ansible.builtin.unarchive:
|
|
src: /opt/firefox.tar.xz
|
|
dest: /opt
|
|
remote_src: true
|
|
|
|
- name: Maak een symlink voor Firefox
|
|
ansible.builtin.file:
|
|
src: /opt/firefox/firefox
|
|
dest: /usr/local/bin/firefox
|
|
state: link
|
|
|
|
- name: Installeer benodigde pakketten
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
name:
|
|
- libgtk-3-0
|
|
- libdbus-glib-1-2
|
|
- libpulse0
|
|
- pulseaudio
|
|
- xvfb
|
|
- ffmpeg
|
|
- python3.10-venv
|
|
|
|
- name: Download Geckodriver
|
|
ansible.builtin.get_url:
|
|
url: "https://github.com/mozilla/geckodriver/releases/download/v0.36.0/geckodriver-v0.36.0-linux64.tar.gz"
|
|
dest: /tmp/geckodriver.tar.gz
|
|
mode: '0644'
|
|
|
|
- name: Extract Geckodriver
|
|
ansible.builtin.unarchive:
|
|
src: /tmp/geckodriver.tar.gz
|
|
dest: /usr/local/bin
|
|
remote_src: true
|
|
|
|
- name: Maak Geckodriver executable
|
|
ansible.builtin.file:
|
|
path: /usr/local/bin/geckodriver
|
|
mode: '0755'
|
|
|
|
- name: Verwijder Geckodriver tar.gz
|
|
ansible.builtin.file:
|
|
path: /tmp/geckodriver.tar.gz
|
|
state: absent
|
|
|
|
- name: Maak de map recording aan
|
|
ansible.builtin.file:
|
|
path: /home/ubuntu/recording
|
|
state: directory
|
|
mode: '0755'
|
|
owner: ubuntu
|
|
group: ubuntu
|
|
|
|
- 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
|
|
|
|
- name: Maak virtuele omgeving in recording-map
|
|
ansible.builtin.command:
|
|
cmd: python3 -m venv venv
|
|
chdir: /home/ubuntu/recording
|
|
creates: /home/ubuntu/recording/venv
|
|
|
|
- name: Installeer nextcloud-talk-recording in virtualenv
|
|
ansible.builtin.pip:
|
|
name: file:///home/ubuntu/recording/nextcloud-talk-recording
|
|
virtualenv: /home/ubuntu/recording/venv
|
|
|
|
- name: Maak een lege server.conf aan (of wis bestaande inhoud)
|
|
ansible.builtin.copy:
|
|
content: ''
|
|
dest: /home/ubuntu/recording/server.conf
|
|
|
|
- name: Voeg inhoud toe aan server.conf
|
|
ansible.builtin.blockinfile:
|
|
path: /home/ubuntu/recording/server.conf
|
|
block: |
|
|
[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: Start recording via nohup
|
|
ansible.builtin.shell: |
|
|
source /home/ubuntu/recording/venv/bin/activate
|
|
nohup python3 -m nextcloud.talk.recording -c /home/ubuntu/recording/server.conf > /home/ubuntu/recording/output.log 2>&1 &
|
|
args:
|
|
executable: /bin/bash
|