You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
---
|
|
|
|
- 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'
|
|
|
|
- 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
|
|
delegate_to: 127.0.0.1
|
|
command: |
|
|
openssl rand -hex 16
|
|
register: generic_secret
|
|
no_log: true
|
|
when: presence is not changed
|
|
|
|
- name: Add new matrix_homeserver_generic_secret_key variable if not present
|
|
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'
|
|
state: present
|
|
when: presence is not changed
|