From a60a43cb08b574980112b8856ee4cee0d948fd22 Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Sat, 9 Oct 2021 15:21:10 +0800 Subject: [PATCH] change naming scheme of variables that feature in deploy. --- .../matrix-awx/surveys/access_export.json.j2 | 6 +- .../surveys/configure_dimension.json.j2 | 4 +- .../surveys/configure_ma1sd.json.j2 | 8 +- .../surveys/configure_synapse.json.j2 | 26 +++---- .../configure_website_access_export.json.j2 | 14 ++-- .../tasks/customise_website_access_export.yml | 50 ++++++------ .../tasks/set_variables_dimension.yml | 16 ++-- .../tasks/set_variables_element.yml | 16 ++-- .../matrix-awx/tasks/set_variables_ma1sd.yml | 16 ++-- .../tasks/set_variables_synapse.yml | 78 +++++++++---------- 10 files changed, 117 insertions(+), 117 deletions(-) diff --git a/roles/matrix-awx/surveys/access_export.json.j2 b/roles/matrix-awx/surveys/access_export.json.j2 index c20a97493..6e16ab4be 100644 --- a/roles/matrix-awx/surveys/access_export.json.j2 +++ b/roles/matrix-awx/surveys/access_export.json.j2 @@ -8,7 +8,7 @@ "required": true, "min": null, "max": null, - "default": "{{ sftp_auth_method | string }}", + "default": "{{ awx_sftp_auth_method | string }}", "choices": "Disabled\nPassword\nSSH Key", "new_question": true, "variable": "sftp_auth_method", @@ -20,7 +20,7 @@ "required": false, "min": 0, "max": 64, - "default": "{{ sftp_password }}", + "default": "{{ awx_sftp_password }}", "choices": "", "new_question": true, "variable": "sftp_password", @@ -32,7 +32,7 @@ "required": false, "min": 0, "max": 16384, - "default": "{{ sftp_public_key }}", + "default": "{{ awx_sftp_public_key }}", "choices": "", "new_question": true, "variable": "sftp_public_key", diff --git a/roles/matrix-awx/surveys/configure_dimension.json.j2 b/roles/matrix-awx/surveys/configure_dimension.json.j2 index 2f39e80e3..961d137c6 100644 --- a/roles/matrix-awx/surveys/configure_dimension.json.j2 +++ b/roles/matrix-awx/surveys/configure_dimension.json.j2 @@ -20,10 +20,10 @@ "required": false, "min": 0, "max": 65536, - "default": {{ ext_dimension_users_raw_final | to_json }}, + "default": {{ awx_dimension_users_raw_final | to_json }}, "choices": "", "new_question": true, - "variable": "ext_dimension_users_raw", + "variable": "awx_dimension_users_raw", "type": "textarea" } ] diff --git a/roles/matrix-awx/surveys/configure_ma1sd.json.j2 b/roles/matrix-awx/surveys/configure_ma1sd.json.j2 index 67c2c88d7..055e817c8 100644 --- a/roles/matrix-awx/surveys/configure_ma1sd.json.j2 +++ b/roles/matrix-awx/surveys/configure_ma1sd.json.j2 @@ -20,10 +20,10 @@ "required": false, "min": null, "max": null, - "default": "{{ ext_matrix_ma1sd_auth_store }}", + "default": "{{ awx_matrix_ma1sd_auth_store }}", "choices": "Synapse Internal\nLDAP/AD", "new_question": true, - "variable": "ext_matrix_ma1sd_auth_store", + "variable": "awx_matrix_ma1sd_auth_store", "type": "multiplechoice" }, { @@ -32,9 +32,9 @@ "required": false, "min": 0, "max": 65536, - "default": {{ ext_matrix_ma1sd_configuration_extension_yaml | to_json }}, + "default": {{ awx_matrix_ma1sd_configuration_extension_yaml | to_json }}, "new_question": true, - "variable": "ext_matrix_ma1sd_configuration_extension_yaml", + "variable": "awx_matrix_ma1sd_configuration_extension_yaml", "type": "textarea" } ] diff --git a/roles/matrix-awx/surveys/configure_synapse.json.j2 b/roles/matrix-awx/surveys/configure_synapse.json.j2 index 7089f7b38..029b1fbe0 100755 --- a/roles/matrix-awx/surveys/configure_synapse.json.j2 +++ b/roles/matrix-awx/surveys/configure_synapse.json.j2 @@ -92,10 +92,10 @@ "required": false, "min": null, "max": null, - "default": "{{ ext_registrations_require_3pid | string | lower }}", + "default": "{{ awx_registrations_require_3pid | string | lower }}", "choices": "true\nfalse", "new_question": true, - "variable": "ext_registrations_require_3pid", + "variable": "awx_registrations_require_3pid", "type": "multiplechoice" }, { @@ -107,7 +107,7 @@ "default": "", "choices": "", "new_question": true, - "variable": "ext_matrix_synapse_registration_shared_secret", + "variable": "awx_matrix_synapse_registration_shared_secret", "type": "password" }, { @@ -128,10 +128,10 @@ "required": false, "min": 0, "max": 65536, - "default": {{ ext_url_preview_accept_language_default | to_json }}, + "default": {{ awx_url_preview_accept_language_default | to_json }}, "choices": "", "new_question": true, - "variable": "ext_url_preview_accept_language_raw", + "variable": "awx_url_preview_accept_language_raw", "type": "textarea" }, { @@ -140,10 +140,10 @@ "required": false, "min": 0, "max": 65536, - "default": {{ ext_federation_whitelist_raw | to_json }}, + "default": {{ awx_federation_whitelist_raw | to_json }}, "choices": "", "new_question": true, - "variable": "ext_federation_whitelist_raw", + "variable": "awx_federation_whitelist_raw", "type": "textarea" }, { @@ -164,10 +164,10 @@ "required": false, "min": null, "max": null, - "default": "{{ ext_enable_registration_captcha | string | lower }}", + "default": "{{ awx_enable_registration_captcha | string | lower }}", "choices": "true\nfalse", "new_question": true, - "variable": "ext_enable_registration_captcha", + "variable": "awx_enable_registration_captcha", "type": "multiplechoice" }, { @@ -176,10 +176,10 @@ "required": false, "min": 0, "max": 40, - "default": "{{ ext_recaptcha_public_key }}", + "default": "{{ awx_recaptcha_public_key }}", "choices": "", "new_question": true, - "variable": "ext_recaptcha_public_key", + "variable": "awx_recaptcha_public_key", "type": "text" }, { @@ -188,10 +188,10 @@ "required": false, "min": 0, "max": 40, - "default": "{{ ext_recaptcha_private_key }}", + "default": "{{ awx_recaptcha_private_key }}", "choices": "", "new_question": true, - "variable": "ext_recaptcha_private_key", + "variable": "awx_recaptcha_private_key", "type": "text" } ] diff --git a/roles/matrix-awx/surveys/configure_website_access_export.json.j2 b/roles/matrix-awx/surveys/configure_website_access_export.json.j2 index 2b3e16376..bc805f099 100755 --- a/roles/matrix-awx/surveys/configure_website_access_export.json.j2 +++ b/roles/matrix-awx/surveys/configure_website_access_export.json.j2 @@ -8,7 +8,7 @@ "required": true, "min": null, "max": null, - "default": "{{ customise_base_domain_website | string | lower }}", + "default": "{{ awx_customise_base_domain_website | string | lower }}", "choices": "true\nfalse", "new_question": true, "variable": "customise_base_domain_website", @@ -20,10 +20,10 @@ "required": true, "min": null, "max": null, - "default": "{{ sftp_auth_method | string }}", + "default": "{{ awx_sftp_auth_method | string }}", "choices": "Disabled\nPassword\nSSH Key", "new_question": true, - "variable": "sftp_auth_method", + "variable": "awx_sftp_auth_method", "type": "multiplechoice" }, { @@ -32,10 +32,10 @@ "required": false, "min": 0, "max": 64, - "default": "{{ sftp_password }}", + "default": "{{ awx_sftp_password }}", "choices": "", "new_question": true, - "variable": "sftp_password", + "variable": "awx_sftp_password", "type": "password" }, { @@ -44,10 +44,10 @@ "required": false, "min": 0, "max": 16384, - "default": "{{ sftp_public_key }}", + "default": "{{ awx_sftp_public_key }}", "choices": "", "new_question": true, - "variable": "sftp_public_key", + "variable": "awx_sftp_public_key", "type": "text" } ] diff --git a/roles/matrix-awx/tasks/customise_website_access_export.yml b/roles/matrix-awx/tasks/customise_website_access_export.yml index 076e31882..e82621d0a 100755 --- a/roles/matrix-awx/tasks/customise_website_access_export.yml +++ b/roles/matrix-awx/tasks/customise_website_access_export.yml @@ -8,7 +8,7 @@ insertafter: '# Base Domain Settings Start' with_dict: 'matrix_nginx_proxy_base_domain_homepage_enabled': 'true' - when: (customise_base_domain_website is defined) and not customise_base_domain_website|bool + when: (awx_customise_base_domain_website is defined) and not awx_customise_base_domain_website|bool - name: Disable index.html creation to allow multi-file site if user does wish to customise base domain delegate_to: 127.0.0.1 @@ -19,7 +19,7 @@ insertafter: '# Base Domain Settings Start' with_dict: 'matrix_nginx_proxy_base_domain_homepage_enabled': 'false' - when: (customise_base_domain_website is defined) and customise_base_domain_website|bool + when: (awx_customise_base_domain_website is defined) and awx_customise_base_domain_website|bool - name: Record custom 'Customise Website + Access Export' variables locally on AWX delegate_to: 127.0.0.1 @@ -29,9 +29,9 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Custom Settings Start' with_dict: - 'sftp_auth_method': '"{{ sftp_auth_method }}"' - 'sftp_password': '"{{ sftp_password }}"' - 'sftp_public_key': '"{{ sftp_public_key }}"' + 'awx_sftp_auth_method': '"{{ awx_sftp_auth_method }}"' + 'awx_sftp_password': '"{{ awx_sftp_password }}"' + 'awx_sftp_public_key': '"{{ awx_sftp_public_key }}"' - name: Record custom 'Customise Website + Access Export' variables locally on AWX delegate_to: 127.0.0.1 @@ -41,8 +41,8 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Custom Settings Start' with_dict: - 'customise_base_domain_website': '{{ customise_base_domain_website }}' - when: customise_base_domain_website is defined + 'awx_customise_base_domain_website': '{{ awx_customise_base_domain_website }}' + when: awx_customise_base_domain_website is defined - name: Reload vars in matrix_vars.yml include_vars: @@ -54,28 +54,28 @@ template: src: './roles/matrix-awx/surveys/configure_website_access_export.json.j2' dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_website_access_export.json' - when: customise_base_domain_website is defined + when: awx_customise_base_domain_website is defined - name: Copy new 'Customise Website + Access Export' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_website_access_export.json' dest: '/matrix/awx/configure_website_access_export.json' mode: '0660' - when: customise_base_domain_website is defined + when: awx_customise_base_domain_website is defined - name: Save new 'Customise Website + Access Export' survey.json to the AWX tower, template delegate_to: 127.0.0.1 template: src: './roles/matrix-awx/surveys/access_export.json.j2' dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/access_export.json' - when: customise_base_domain_website is undefined + when: awx_customise_base_domain_website is undefined - name: Copy new 'Customise Website + Access Export' survey.json to target machine copy: src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/access_export.json' dest: '/matrix/awx/access_export.json' mode: '0660' - when: customise_base_domain_website is undefined + when: awx_customise_base_domain_website is undefined - name: Recreate 'Configure Website + Access Export' job template delegate_to: 127.0.0.1 @@ -97,7 +97,7 @@ tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" validate_certs: yes - when: customise_base_domain_website is defined + when: awx_customise_base_domain_website is defined - name: Recreate 'Access Export' job template delegate_to: 127.0.0.1 @@ -119,9 +119,9 @@ tower_host: "https://{{ awx_host }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" validate_certs: yes - when: customise_base_domain_website is undefined + when: awx_customise_base_domain_website is undefined -- name: If user doesn't define a sftp_password, create a disabled 'sftp' account +- name: If user doesn't define a awx_sftp_password, create a disabled 'sftp' account user: name: sftp comment: SFTP user to set custom web files and access servers export @@ -130,18 +130,18 @@ group: matrix password: '*' update_password: always - when: sftp_password|length == 0 + when: awx_sftp_password|length == 0 -- name: If user defines sftp_password, enable account and set password on 'stfp' account +- name: If user defines awx_sftp_password, enable account and set password on 'stfp' account user: name: sftp comment: SFTP user to set custom web files and access servers export shell: /bin/false home: /home/sftp group: matrix - password: "{{ sftp_password | password_hash('sha512') }}" + password: "{{ awx_sftp_password | password_hash('sha512') }}" update_password: always - when: sftp_password|length > 0 + when: awx_sftp_password|length > 0 - name: Ensure group "sftp" exists group: @@ -153,7 +153,7 @@ name: sftp groups: sftp append: yes - when: customise_base_domain_website is defined + when: awx_customise_base_domain_website is defined - name: Create the ro /chroot directory with sticky bit if it doesn't exist. (/chroot/website has matrix:matrix permissions and is mounted to nginx container) file: @@ -170,7 +170,7 @@ owner: matrix group: matrix mode: '0770' - when: customise_base_domain_website is defined + when: awx_customise_base_domain_website is defined - name: Ensure /chroot/export location exists file: @@ -202,11 +202,11 @@ - name: Insert public SSH key into authorized_keys file lineinfile: path: /home/sftp/.ssh/authorized_keys - line: "{{ sftp_public_key }}" + line: "{{ awx_sftp_public_key }}" owner: sftp group: sftp mode: '0644' - when: (sftp_public_key | length > 0) and (sftp_auth_method == "SSH Key") + when: (awx_sftp_public_key | length > 0) and (awx_sftp_auth_method == "SSH Key") - name: Remove any existing Subsystem lines lineinfile: @@ -232,7 +232,7 @@ AllowTcpForwarding no PasswordAuthentication yes AuthorizedKeysFile /home/sftp/.ssh/authorized_keys - when: sftp_auth_method == "Disabled" + when: awx_sftp_auth_method == "Disabled" - name: Add SSH Match User section for password auth blockinfile: @@ -245,7 +245,7 @@ X11Forwarding no AllowTcpForwarding no PasswordAuthentication yes - when: sftp_auth_method == "Password" + when: awx_sftp_auth_method == "Password" - name: Add SSH Match User section for publickey auth blockinfile: @@ -258,7 +258,7 @@ X11Forwarding no AllowTcpForwarding no AuthorizedKeysFile /home/sftp/.ssh/authorized_keys - when: sftp_auth_method == "SSH Key" + when: awx_sftp_auth_method == "SSH Key" - name: Restart service ssh.service service: diff --git a/roles/matrix-awx/tasks/set_variables_dimension.yml b/roles/matrix-awx/tasks/set_variables_dimension.yml index 338cd82c4..a3a6d314b 100644 --- a/roles/matrix-awx/tasks/set_variables_dimension.yml +++ b/roles/matrix-awx/tasks/set_variables_dimension.yml @@ -14,7 +14,7 @@ - name: Collect access token of Dimension user shell: | curl -X POST --header 'Content-Type: application/json' -d '{ "identifier": { "type": "m.id.user","user": "dimension" }, "password": "{{ matrix_awx_dimension_user_password }}", "type": "m.login.password"}' 'https://matrix.{{ matrix_domain }}/_matrix/client/r0/login' | jq -c '. | {access_token}' | sed 's/.*\":\"//' | sed 's/\"}//' - register: dimension_user_access_token + register: awx_dimension_user_access_token - name: Record Synapse variables locally on AWX delegate_to: 127.0.0.1 @@ -25,17 +25,17 @@ insertafter: '# Dimension Settings Start' with_dict: 'matrix_dimension_enabled': '{{ matrix_dimension_enabled }}' - 'matrix_dimension_access_token': '"{{ dimension_user_access_token.stdout }}"' + 'matrix_dimension_access_token': '"{{ awx_dimension_user_access_token.stdout }}"' - name: Set final users list if users are defined set_fact: - ext_dimension_users_raw_final: "{{ ext_dimension_users_raw }}" - when: ext_dimension_users_raw|length > 0 + awx_dimension_users_raw_final: "{{ awx_dimension_users_raw }}" + when: awx_dimension_users_raw|length > 0 - name: Set final users list if no users are defined set_fact: - ext_dimension_users_raw_final: '@dimension:{{ matrix_domain }}' - when: ext_dimension_users_raw|length == 0 + awx_dimension_users_raw_final: '@dimension:{{ matrix_domain }}' + when: awx_dimension_users_raw|length == 0 - name: Remove Dimension Users delegate_to: 127.0.0.1 @@ -58,7 +58,7 @@ path: '{{ awx_cached_matrix_vars }}' insertafter: '^matrix_dimension_admins:' line: ' - "{{ item }}"' - with_items: "{{ ext_dimension_users_raw_final.splitlines() }}" + with_items: "{{ awx_dimension_users_raw_final.splitlines() }}" - name: Record Dimension Custom variables locally on AWX delegate_to: 127.0.0.1 @@ -68,7 +68,7 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Custom Settings Start' with_dict: - 'ext_dimension_users_raw': '{{ ext_dimension_users_raw.splitlines() | to_json }}' + 'awx_dimension_users_raw': '{{ awx_dimension_users_raw.splitlines() | to_json }}' - name: Save new 'Configure Dimension' survey.json to the AWX tower, template delegate_to: 127.0.0.1 diff --git a/roles/matrix-awx/tasks/set_variables_element.yml b/roles/matrix-awx/tasks/set_variables_element.yml index 6d7d40064..6bf9be36e 100755 --- a/roles/matrix-awx/tasks/set_variables_element.yml +++ b/roles/matrix-awx/tasks/set_variables_element.yml @@ -39,7 +39,7 @@ insertafter: '# Element Settings Start' with_dict: 'matrix_client_element_welcome_logo': '{{ awx_matrix_client_element_welcome_logo }}' - when: ( awx_https_string in awx_matrix_client_element_welcome_logo ) and ( awx_matrix_client_element_welcome_logo|trim|length > 0 ) + when: ( awx_https_string in awx_matrix_client_element_welcome_logo ) and ( awx_matrix_client_element_welcome_logo | trim | length > 0 ) - name: Remove custom logo locally on AWX if not defined delegate_to: 127.0.0.1 @@ -47,7 +47,7 @@ path: '{{ awx_cached_matrix_vars }}' regexp: "^matrix_client_element_welcome_logo: " state: absent - when: awx_matrix_client_element_welcome_logo|trim|length == 0 + when: awx_matrix_client_element_welcome_logo | trim | length == 0 - name: Set custom logo link locally on AWX if defined delegate_to: 127.0.0.1 @@ -58,7 +58,7 @@ insertafter: '# Element Settings Start' with_dict: 'matrix_client_element_welcome_logo_link': '{{ awx_matrix_client_element_welcome_logo_link }}' - when: ( awx_https_string in awx_matrix_client_element_welcome_logo_link ) and ( awx_matrix_client_element_welcome_logo_link|trim|length > 0 ) + when: ( awx_https_string in awx_matrix_client_element_welcome_logo_link ) and ( awx_matrix_client_element_welcome_logo_link | trim | length > 0 ) - name: Remove custom logo link locally on AWX if not defined delegate_to: 127.0.0.1 @@ -66,7 +66,7 @@ path: '{{ awx_cached_matrix_vars }}' regexp: "^matrix_client_element_welcome_logo_link: " state: absent - when: awx_matrix_client_element_welcome_logo_link|trim|length == 0 + when: awx_matrix_client_element_welcome_logo_link | trim | length == 0 - name: Set custom headline locally on AWX if defined delegate_to: 127.0.0.1 @@ -77,7 +77,7 @@ insertafter: '# Element Settings Start' with_dict: 'matrix_client_element_welcome_headline': '{{ awx_matrix_client_element_welcome_headline }}' - when: awx_matrix_client_element_welcome_headline|trim|length > 0 + when: awx_matrix_client_element_welcome_headline | trim | length > 0 - name: Remove custom headline locally on AWX if not defined delegate_to: 127.0.0.1 @@ -85,7 +85,7 @@ path: '{{ awx_cached_matrix_vars }}' regexp: "^matrix_client_element_welcome_headline: " state: absent - when: awx_matrix_client_element_welcome_headline|trim|length == 0 + when: awx_matrix_client_element_welcome_headline | trim | length == 0 - name: Set custom text locally on AWX if defined delegate_to: 127.0.0.1 @@ -96,7 +96,7 @@ insertafter: '# Element Settings Start' with_dict: 'matrix_client_element_welcome_text': '{{ awx_matrix_client_element_welcome_text }}' - when: awx_matrix_client_element_welcome_text|trim|length > 0 + when: awx_matrix_client_element_welcome_text | trim | length > 0 - name: Remove custom text locally on AWX if not defined delegate_to: 127.0.0.1 @@ -115,7 +115,7 @@ insertafter: '# Element Settings Start' with_dict: 'matrix_client_element_branding_welcomeBackgroundUrl': '{{ matrix_client_element_branding_welcomeBackgroundUrl }}' - when: ( awx_https_string in matrix_client_element_branding_welcomeBackgroundUrl ) and ( matrix_client_element_branding_welcomeBackgroundUrl|length > 0 ) + when: ( awx_https_string in matrix_client_element_branding_welcomeBackgroundUrl ) and ( matrix_client_element_branding_welcomeBackgroundUrl | length > 0 ) - name: Save new 'Configure Element' survey.json to the AWX tower, template delegate_to: 127.0.0.1 diff --git a/roles/matrix-awx/tasks/set_variables_ma1sd.yml b/roles/matrix-awx/tasks/set_variables_ma1sd.yml index 6b4b09e3e..c147a229a 100755 --- a/roles/matrix-awx/tasks/set_variables_ma1sd.yml +++ b/roles/matrix-awx/tasks/set_variables_ma1sd.yml @@ -17,8 +17,8 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Synapse Extension Start' with_dict: - 'matrix_synapse_ext_password_provider_rest_auth_enabled': 'false' - when: ext_matrix_ma1sd_auth_store == 'Synapse Internal' + 'matrix_synapse_awx_password_provider_rest_auth_enabled': 'false' + when: awx_matrix_ma1sd_auth_store == 'Synapse Internal' - name: Enable REST auth if using external LDAP/AD with ma1sd delegate_to: 127.0.0.1 @@ -28,9 +28,9 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Synapse Extension Start' with_dict: - 'matrix_synapse_ext_password_provider_rest_auth_enabled': 'true' - 'matrix_synapse_ext_password_provider_rest_auth_endpoint': '"http://matrix-ma1sd:8090"' - when: ext_matrix_ma1sd_auth_store == 'LDAP/AD' + 'matrix_synapse_awx_password_provider_rest_auth_enabled': 'true' + 'matrix_synapse_awx_password_provider_rest_auth_endpoint': '"http://matrix-ma1sd:8090"' + when: awx_matrix_ma1sd_auth_store == 'LDAP/AD' - name: Remove entire ma1sd configuration extension delegate_to: 127.0.0.1 @@ -53,7 +53,7 @@ path: '{{ awx_cached_matrix_vars }}' marker: "# {mark} ma1sd ANSIBLE MANAGED BLOCK" insertafter: '# Start ma1sd Extension' - block: '{{ ext_matrix_ma1sd_configuration_extension_yaml }}' + block: '{{ awx_matrix_ma1sd_configuration_extension_yaml }}' - name: Record ma1sd Custom variables locally on AWX delegate_to: 127.0.0.1 @@ -63,8 +63,8 @@ line: "{{ item.key }}: {{ item.value }}" insertbefore: '# Custom Settings Start' with_dict: - 'ext_matrix_ma1sd_auth_store': '{{ ext_matrix_ma1sd_auth_store }}' - 'ext_matrix_ma1sd_configuration_extension_yaml': '{{ ext_matrix_ma1sd_configuration_extension_yaml.splitlines() | to_json }}' + 'awx_matrix_ma1sd_auth_store': '{{ awx_matrix_ma1sd_auth_store }}' + 'awx_matrix_ma1sd_configuration_extension_yaml': '{{ awx_matrix_ma1sd_configuration_extension_yaml.splitlines() | to_json }}' no_log: True - name: Save new 'Configure ma1sd' survey.json to the AWX tower, template diff --git a/roles/matrix-awx/tasks/set_variables_synapse.yml b/roles/matrix-awx/tasks/set_variables_synapse.yml index d32d18e1f..0b0fff788 100755 --- a/roles/matrix-awx/tasks/set_variables_synapse.yml +++ b/roles/matrix-awx/tasks/set_variables_synapse.yml @@ -26,21 +26,21 @@ 'matrix_synapse_url_preview_enabled': '{{ matrix_synapse_url_preview_enabled }}' 'matrix_synapse_allow_guest_access': '{{ matrix_synapse_allow_guest_access }}' -- name: Empty Synapse variable 'matrix_synapse_auto_join_rooms' locally on AWX, if raw inputs empty +- name: Empty Synapse variable 'awx_matrix_synapse_auto_join_rooms' locally on AWX, if raw inputs empty delegate_to: 127.0.0.1 replace: path: '{{ awx_cached_matrix_vars }}' - regexp: "^matrix_synapse_auto_join_rooms: .*$" - replace: "matrix_synapse_auto_join_rooms: []" - when: matrix_synapse_auto_join_rooms_raw|length == 0 + regexp: "^awx_matrix_synapse_auto_join_rooms: .*$" + replace: "awx_matrix_synapse_auto_join_rooms: []" + when: awx_matrix_synapse_auto_join_rooms_raw|length == 0 - name: If the raw inputs is not empty start constructing parsed auto_join_rooms list set_fact: - matrix_synapse_auto_join_rooms_array: |- - {{ matrix_synapse_auto_join_rooms_raw.splitlines() | to_json }} - when: matrix_synapse_auto_join_rooms_raw|length > 0 + awx_matrix_synapse_auto_join_rooms_array: |- + {{ awx_matrix_synapse_auto_join_rooms_raw.splitlines() | to_json }} + when: awx_matrix_synapse_auto_join_rooms_raw|length > 0 -- name: Record Synapse variable 'matrix_synapse_auto_join_rooms' locally on AWX, if it's not blank +- name: Record Synapse variable 'awx_matrix_synapse_auto_join_rooms' locally on AWX, if it's not blank delegate_to: 127.0.0.1 lineinfile: path: '{{ awx_cached_matrix_vars }}' @@ -48,8 +48,8 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Synapse Settings Start' with_dict: - "matrix_synapse_auto_join_rooms": "{{ matrix_synapse_auto_join_rooms_array }}" - when: matrix_synapse_auto_join_rooms_raw|length > 0 + "awx_matrix_synapse_auto_join_rooms": "{{ awx_matrix_synapse_auto_join_rooms_array }}" + when: awx_matrix_synapse_auto_join_rooms_raw|length > 0 - name: Record Synapse Shared Secret if it's defined delegate_to: 127.0.0.1 @@ -59,8 +59,8 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Synapse Settings Start' with_dict: - 'matrix_synapse_registration_shared_secret': '{{ ext_matrix_synapse_registration_shared_secret }}' - when: ext_matrix_synapse_registration_shared_secret|length > 0 + 'matrix_synapse_registration_shared_secret': '{{ awx_matrix_synapse_registration_shared_secret }}' + when: awx_matrix_synapse_registration_shared_secret|length > 0 - name: Record registations_require_3pid extra variable if true delegate_to: 127.0.0.1 @@ -72,7 +72,7 @@ with_items: - " registrations_require_3pid:" - " - email" - when: ext_registrations_require_3pid|bool + when: awx_registrations_require_3pid|bool - name: Remove registrations_require_3pid extra variable if false delegate_to: 127.0.0.1 @@ -85,7 +85,7 @@ with_items: - " registrations_require_3pid:" - " - email" - when: not ext_registrations_require_3pid|bool + when: not awx_registrations_require_3pid|bool - name: Remove URL Languages delegate_to: 127.0.0.1 @@ -97,21 +97,21 @@ - name: Set URL languages default if raw inputs empty set_fact: - ext_url_preview_accept_language_default: 'en' - when: ext_url_preview_accept_language_raw|length == 0 + awx_url_preview_accept_language_default: 'en' + when: awx_url_preview_accept_language_raw|length == 0 - name: Set URL languages default if raw inputs not empty set_fact: - ext_url_preview_accept_language_default: "{{ ext_url_preview_accept_language_raw }}" - when: ext_url_preview_accept_language_raw|length > 0 + awx_url_preview_accept_language_default: "{{ awx_url_preview_accept_language_raw }}" + when: awx_url_preview_accept_language_raw|length > 0 - name: Set URL languages if raw inputs empty delegate_to: 127.0.0.1 lineinfile: path: '{{ awx_cached_matrix_vars }}' insertafter: '^ url_preview_accept_language:' - line: " - {{ ext_url_preview_accept_language_default }}" - when: ext_url_preview_accept_language_raw|length == 0 + line: " - {{ awx_url_preview_accept_language_default }}" + when: awx_url_preview_accept_language_raw|length == 0 - name: Set URL languages if raw inputs not empty delegate_to: 127.0.0.1 @@ -119,8 +119,8 @@ path: '{{ awx_cached_matrix_vars }}' insertafter: '^ url_preview_accept_language:' line: " - {{ item }}" - with_items: "{{ ext_url_preview_accept_language_raw.splitlines() }}" - when: ext_url_preview_accept_language_raw|length > 0 + with_items: "{{ awx_url_preview_accept_language_raw.splitlines() }}" + when: awx_url_preview_accept_language_raw|length > 0 - name: Remove Federation Whitelisting 1 delegate_to: 127.0.0.1 @@ -143,7 +143,7 @@ path: '{{ awx_cached_matrix_vars }}' insertafter: '^matrix_synapse_configuration_extension_yaml: \|' line: " federation_domain_whitelist:" - when: ext_federation_whitelist_raw|length > 0 + when: awx_federation_whitelist_raw|length > 0 - name: Set Federation Whitelisting 2 delegate_to: 127.0.0.1 @@ -151,16 +151,16 @@ path: '{{ awx_cached_matrix_vars }}' insertafter: '^ federation_domain_whitelist:' line: " - {{ item }}" - with_items: "{{ ext_federation_whitelist_raw.splitlines() }}" - when: ext_federation_whitelist_raw|length > 0 + with_items: "{{ awx_federation_whitelist_raw.splitlines() }}" + when: awx_federation_whitelist_raw|length > 0 -- name: Set ext_recaptcha_public_key to a 'public-key' if undefined - set_fact: ext_recaptcha_public_key="public-key" - when: (ext_recaptcha_public_key is not defined) or (ext_recaptcha_public_key|length == 0) +- name: Set awx_recaptcha_public_key to a 'public-key' if undefined + set_fact: awx_recaptcha_public_key="public-key" + when: (awx_recaptcha_public_key is not defined) or (awx_recaptcha_public_key|length == 0) -- name: Set ext_recaptcha_private_key to a 'private-key' if undefined - set_fact: ext_recaptcha_private_key="private-key" - when: (ext_recaptcha_private_key is not defined) or (ext_recaptcha_private_key|length == 0) +- name: Set awx_recaptcha_private_key to a 'private-key' if undefined + set_fact: awx_recaptcha_private_key="private-key" + when: (awx_recaptcha_private_key is not defined) or (awx_recaptcha_private_key|length == 0) - name: Record Synapse Extension variables locally on AWX delegate_to: 127.0.0.1 @@ -170,9 +170,9 @@ line: "{{ item.key }}: {{ item.value }}" insertbefore: '# Synapse Extension End' with_dict: - ' enable_registration_captcha': '{{ ext_enable_registration_captcha }}' - ' recaptcha_public_key': '{{ ext_recaptcha_public_key }}' - ' recaptcha_private_key': '{{ ext_recaptcha_private_key }}' + ' enable_registration_captcha': '{{ awx_enable_registration_captcha }}' + ' recaptcha_public_key': '{{ awx_recaptcha_public_key }}' + ' recaptcha_private_key': '{{ awx_recaptcha_private_key }}' - name: Record Synapse Custom variables locally on AWX delegate_to: 127.0.0.1 @@ -182,11 +182,11 @@ line: "{{ item.key }}: {{ item.value }}" insertafter: '# Custom Settings Start' with_dict: - 'ext_federation_whitelist_raw': '{{ ext_federation_whitelist_raw.splitlines() | to_json }}' - 'ext_url_preview_accept_language_default': '{{ ext_url_preview_accept_language_default.splitlines() | to_json }}' - 'ext_enable_registration_captcha': '{{ ext_enable_registration_captcha }}' - 'ext_recaptcha_public_key': '"{{ ext_recaptcha_public_key }}"' - 'ext_recaptcha_private_key': '"{{ ext_recaptcha_private_key }}"' + 'awx_federation_whitelist_raw': '{{ awx_federation_whitelist_raw.splitlines() | to_json }}' + 'awx_url_preview_accept_language_default': '{{ awx_url_preview_accept_language_default.splitlines() | to_json }}' + 'awx_enable_registration_captcha': '{{ awx_enable_registration_captcha }}' + 'awx_recaptcha_public_key': '"{{ awx_recaptcha_public_key }}"' + 'awx_recaptcha_private_key': '"{{ awx_recaptcha_private_key }}"' - name: Save new 'Configure Synapse' survey.json to the AWX tower, template delegate_to: 127.0.0.1