Skip to content

Commit

Permalink
Merge pull request #67 from systemli/remove_prosody_user_creation
Browse files Browse the repository at this point in the history
Remove prosody user creation to rely on jitsi's internal one
  • Loading branch information
xshadow authored Jan 20, 2022
2 parents 8b77a15 + e418bdd commit 56e7141
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 23 additions & 1 deletion tasks/jitsi-meet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -96,4 +117,5 @@
name: jicofo
enabled: yes

- meta: flush_handlers
- name: Flush handlers
meta: flush_handlers
6 changes: 1 addition & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

- name: Derive individual secrets from base secret
set_fact:
"{{ item }}": "{{ (item + jitsi_meet_base_secret | string) | hash('sha1') }}"
loop:
- jitsi_meet_videobridge_secret
- jitsi_meet_jicofo_password
- 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
Expand Down
22 changes: 2 additions & 20 deletions tasks/prosody.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,8 @@
state: link
notify:
- update ca-certificates

- 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: Flush handlers
meta: flush_handlers

- name: Enable prosody
service:
Expand Down

0 comments on commit 56e7141

Please sign in to comment.