From 842c63e038b708b53c93dae0e50afddfe7a41ff2 Mon Sep 17 00:00:00 2001 From: shadow Date: Thu, 20 Jan 2022 17:16:07 +0100 Subject: [PATCH 1/2] Remove prosody user creation to rely on jitsi's internal one * collect autogenerated password on jitsi install from config files and re-use in future configurations --- tasks/jitsi-meet.yml | 21 +++++++++++++++++++++ tasks/main.yml | 2 -- tasks/prosody.yml | 18 ------------------ 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/tasks/jitsi-meet.yml b/tasks/jitsi-meet.yml index fbbd4f2..181b363 100644 --- a/tasks/jitsi-meet.yml +++ b/tasks/jitsi-meet.yml @@ -35,6 +35,27 @@ state: present cache_valid_time: 3600 +- name: Get jitsi_meet_videobridge_secret from config file + command: sed -ne 's/^JICOFO_AUTH_PASSWORD=\(\S\+\)\s*$/\1/p' /etc/jitsi/jicofo/config + args: + warn: False + check_mode: no + changed_when: False + register: jitsi_meet_jicofo_password_from_file + +- name: Get jitsi_meet_jicofo_password from config file + command: sed -ne 's/^JVB_SECRET=\(\S\+\)\s*$/\1/p' /etc/jitsi/videobridge/config + args: + warn: False + check_mode: no + changed_when: False + register: jitsi_meet_videobridge_password_from_file + +- name: Set fact for jitsi_meet_videobridge_secret + set_fact: + jitsi_meet_videobridge_secret: "{{ jitsi_meet_videobridge_password_from_file.stdout }}" + jitsi_meet_jicofo_password: "{{ jitsi_meet_jicofo_password_from_file.stdout }}" + - name: Copy sip-communicator.properties template: src: videobridge/sip-communicator.properties.j2 diff --git a/tasks/main.yml b/tasks/main.yml index 396208a..6c1ea8b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,8 +4,6 @@ set_fact: "{{ item }}": "{{ (item + jitsi_meet_base_secret | string) | hash('sha1') }}" loop: - - jitsi_meet_videobridge_secret - - jitsi_meet_jicofo_password - jitsi_meet_turn_secret when: jitsi_meet_base_secret is defined diff --git a/tasks/prosody.yml b/tasks/prosody.yml index ea3c4a1..10fd18d 100644 --- a/tasks/prosody.yml +++ b/tasks/prosody.yml @@ -78,24 +78,6 @@ - meta: flush_handlers -- name: Delete focus prosody account - command: prosodyctl deluser focus@auth.{{ jitsi_meet_server_name }} - failed_when: false - changed_when: false - -- name: Register jicofo agent with Prosody service. - command: prosodyctl register focus auth.{{ jitsi_meet_server_name }} {{ jitsi_meet_jicofo_password }} # noqa: 301 - changed_when: false - -- name: Delete focus prosody account - command: prosodyctl deluser jvb@auth.{{ jitsi_meet_server_name }} - failed_when: false - changed_when: false - -- name: Register jvb agent with Prosody service. - command: prosodyctl register jvb auth.{{ jitsi_meet_server_name }} {{ jitsi_meet_videobridge_secret }} # noqa: 301 - changed_when: false - - name: Enable prosody service: name: prosody From e418bdd9977c07f16e86b15a99cbf7d91d3be063 Mon Sep 17 00:00:00 2001 From: shadow Date: Thu, 20 Jan 2022 17:31:03 +0100 Subject: [PATCH 2/2] Update ansible-lint to latest version --- .github/workflows/main.yml | 2 +- tasks/jitsi-meet.yml | 3 ++- tasks/main.yml | 4 +--- tasks/prosody.yml | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3071792..465d6df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: python-version: '3.x' - name: Install test dependencies. - run: pip3 install ansible-lint==4.3.7 molecule[docker] molecule-goss yamllint + run: pip3 install ansible-lint molecule[docker] molecule-goss yamllint - name: Run Molecule tests. run: molecule test -s docker diff --git a/tasks/jitsi-meet.yml b/tasks/jitsi-meet.yml index 181b363..e419f8d 100644 --- a/tasks/jitsi-meet.yml +++ b/tasks/jitsi-meet.yml @@ -117,4 +117,5 @@ name: jicofo enabled: yes -- meta: flush_handlers +- name: Flush handlers + meta: flush_handlers diff --git a/tasks/main.yml b/tasks/main.yml index 6c1ea8b..60e1d4f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,9 +2,7 @@ - name: Derive individual secrets from base secret set_fact: - "{{ item }}": "{{ (item + jitsi_meet_base_secret | string) | hash('sha1') }}" - loop: - - jitsi_meet_turn_secret + jitsi_meet_turn_secret: "{{ ('jitsi_meet_turn_secret' + jitsi_meet_base_secret | string) | hash('sha1') }}" when: jitsi_meet_base_secret is defined - name: Derive videobridge nickname diff --git a/tasks/prosody.yml b/tasks/prosody.yml index 10fd18d..ca28b9c 100644 --- a/tasks/prosody.yml +++ b/tasks/prosody.yml @@ -75,8 +75,8 @@ state: link notify: - update ca-certificates - -- meta: flush_handlers +- name: Flush handlers + meta: flush_handlers - name: Enable prosody service: