2022-01-09 03:50:44 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Rename synapse presence variable
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
replace:
|
|
|
|
path: "/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml"
|
|
|
|
regexp: 'matrix_synapse_use_presence'
|
|
|
|
replace: 'matrix_synapse_presence_enabled'
|
|
|
|
|
2022-02-23 12:52:56 +01:00
|
|
|
- name: Search for matrix_homeserver_generic_secret_key variable in matrix_vars.yml
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
register: presence
|
|
|
|
shell: "grep -i 'matrix_homeserver_generic_secret_key' /var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml"
|
|
|
|
no_log: true
|
|
|
|
|
|
|
|
- name: Generate matrix_homeserver_generic_secret_key variable if not present
|
2022-01-09 03:50:44 +01:00
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
command: |
|
|
|
|
openssl rand -hex 16
|
|
|
|
register: generic_secret
|
2022-02-05 21:32:54 +01:00
|
|
|
no_log: true
|
2022-02-23 12:52:56 +01:00
|
|
|
when: presence is not changed
|
2022-01-09 03:50:44 +01:00
|
|
|
|
2022-02-23 12:52:56 +01:00
|
|
|
- name: Add new matrix_homeserver_generic_secret_key variable if not present
|
2022-01-09 03:50:44 +01:00
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
lineinfile:
|
|
|
|
path: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml'
|
|
|
|
line: "matrix_homeserver_generic_secret_key: {{ generic_secret.stdout }}"
|
|
|
|
insertbefore: '# Basic Settings End'
|
|
|
|
mode: '0600'
|
2022-02-05 21:32:54 +01:00
|
|
|
state: present
|
2022-02-23 12:52:56 +01:00
|
|
|
when: presence is not changed
|