change naming scheme of variables that feature in deploy.

This commit is contained in:
Michael Collins 2021-10-09 15:21:10 +08:00
parent 42af090a7c
commit a60a43cb08
10 changed files with 117 additions and 117 deletions

View file

@ -8,7 +8,7 @@
"required": true, "required": true,
"min": null, "min": null,
"max": null, "max": null,
"default": "{{ sftp_auth_method | string }}", "default": "{{ awx_sftp_auth_method | string }}",
"choices": "Disabled\nPassword\nSSH Key", "choices": "Disabled\nPassword\nSSH Key",
"new_question": true, "new_question": true,
"variable": "sftp_auth_method", "variable": "sftp_auth_method",
@ -20,7 +20,7 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 64, "max": 64,
"default": "{{ sftp_password }}", "default": "{{ awx_sftp_password }}",
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "sftp_password", "variable": "sftp_password",
@ -32,7 +32,7 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 16384, "max": 16384,
"default": "{{ sftp_public_key }}", "default": "{{ awx_sftp_public_key }}",
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "sftp_public_key", "variable": "sftp_public_key",

View file

@ -20,10 +20,10 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 65536, "max": 65536,
"default": {{ ext_dimension_users_raw_final | to_json }}, "default": {{ awx_dimension_users_raw_final | to_json }},
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "ext_dimension_users_raw", "variable": "awx_dimension_users_raw",
"type": "textarea" "type": "textarea"
} }
] ]

View file

@ -20,10 +20,10 @@
"required": false, "required": false,
"min": null, "min": null,
"max": null, "max": null,
"default": "{{ ext_matrix_ma1sd_auth_store }}", "default": "{{ awx_matrix_ma1sd_auth_store }}",
"choices": "Synapse Internal\nLDAP/AD", "choices": "Synapse Internal\nLDAP/AD",
"new_question": true, "new_question": true,
"variable": "ext_matrix_ma1sd_auth_store", "variable": "awx_matrix_ma1sd_auth_store",
"type": "multiplechoice" "type": "multiplechoice"
}, },
{ {
@ -32,9 +32,9 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 65536, "max": 65536,
"default": {{ ext_matrix_ma1sd_configuration_extension_yaml | to_json }}, "default": {{ awx_matrix_ma1sd_configuration_extension_yaml | to_json }},
"new_question": true, "new_question": true,
"variable": "ext_matrix_ma1sd_configuration_extension_yaml", "variable": "awx_matrix_ma1sd_configuration_extension_yaml",
"type": "textarea" "type": "textarea"
} }
] ]

View file

@ -92,10 +92,10 @@
"required": false, "required": false,
"min": null, "min": null,
"max": null, "max": null,
"default": "{{ ext_registrations_require_3pid | string | lower }}", "default": "{{ awx_registrations_require_3pid | string | lower }}",
"choices": "true\nfalse", "choices": "true\nfalse",
"new_question": true, "new_question": true,
"variable": "ext_registrations_require_3pid", "variable": "awx_registrations_require_3pid",
"type": "multiplechoice" "type": "multiplechoice"
}, },
{ {
@ -107,7 +107,7 @@
"default": "", "default": "",
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "ext_matrix_synapse_registration_shared_secret", "variable": "awx_matrix_synapse_registration_shared_secret",
"type": "password" "type": "password"
}, },
{ {
@ -128,10 +128,10 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 65536, "max": 65536,
"default": {{ ext_url_preview_accept_language_default | to_json }}, "default": {{ awx_url_preview_accept_language_default | to_json }},
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "ext_url_preview_accept_language_raw", "variable": "awx_url_preview_accept_language_raw",
"type": "textarea" "type": "textarea"
}, },
{ {
@ -140,10 +140,10 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 65536, "max": 65536,
"default": {{ ext_federation_whitelist_raw | to_json }}, "default": {{ awx_federation_whitelist_raw | to_json }},
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "ext_federation_whitelist_raw", "variable": "awx_federation_whitelist_raw",
"type": "textarea" "type": "textarea"
}, },
{ {
@ -164,10 +164,10 @@
"required": false, "required": false,
"min": null, "min": null,
"max": null, "max": null,
"default": "{{ ext_enable_registration_captcha | string | lower }}", "default": "{{ awx_enable_registration_captcha | string | lower }}",
"choices": "true\nfalse", "choices": "true\nfalse",
"new_question": true, "new_question": true,
"variable": "ext_enable_registration_captcha", "variable": "awx_enable_registration_captcha",
"type": "multiplechoice" "type": "multiplechoice"
}, },
{ {
@ -176,10 +176,10 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 40, "max": 40,
"default": "{{ ext_recaptcha_public_key }}", "default": "{{ awx_recaptcha_public_key }}",
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "ext_recaptcha_public_key", "variable": "awx_recaptcha_public_key",
"type": "text" "type": "text"
}, },
{ {
@ -188,10 +188,10 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 40, "max": 40,
"default": "{{ ext_recaptcha_private_key }}", "default": "{{ awx_recaptcha_private_key }}",
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "ext_recaptcha_private_key", "variable": "awx_recaptcha_private_key",
"type": "text" "type": "text"
} }
] ]

View file

@ -8,7 +8,7 @@
"required": true, "required": true,
"min": null, "min": null,
"max": null, "max": null,
"default": "{{ customise_base_domain_website | string | lower }}", "default": "{{ awx_customise_base_domain_website | string | lower }}",
"choices": "true\nfalse", "choices": "true\nfalse",
"new_question": true, "new_question": true,
"variable": "customise_base_domain_website", "variable": "customise_base_domain_website",
@ -20,10 +20,10 @@
"required": true, "required": true,
"min": null, "min": null,
"max": null, "max": null,
"default": "{{ sftp_auth_method | string }}", "default": "{{ awx_sftp_auth_method | string }}",
"choices": "Disabled\nPassword\nSSH Key", "choices": "Disabled\nPassword\nSSH Key",
"new_question": true, "new_question": true,
"variable": "sftp_auth_method", "variable": "awx_sftp_auth_method",
"type": "multiplechoice" "type": "multiplechoice"
}, },
{ {
@ -32,10 +32,10 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 64, "max": 64,
"default": "{{ sftp_password }}", "default": "{{ awx_sftp_password }}",
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "sftp_password", "variable": "awx_sftp_password",
"type": "password" "type": "password"
}, },
{ {
@ -44,10 +44,10 @@
"required": false, "required": false,
"min": 0, "min": 0,
"max": 16384, "max": 16384,
"default": "{{ sftp_public_key }}", "default": "{{ awx_sftp_public_key }}",
"choices": "", "choices": "",
"new_question": true, "new_question": true,
"variable": "sftp_public_key", "variable": "awx_sftp_public_key",
"type": "text" "type": "text"
} }
] ]

View file

@ -8,7 +8,7 @@
insertafter: '# Base Domain Settings Start' insertafter: '# Base Domain Settings Start'
with_dict: with_dict:
'matrix_nginx_proxy_base_domain_homepage_enabled': 'true' '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 - name: Disable index.html creation to allow multi-file site if user does wish to customise base domain
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -19,7 +19,7 @@
insertafter: '# Base Domain Settings Start' insertafter: '# Base Domain Settings Start'
with_dict: with_dict:
'matrix_nginx_proxy_base_domain_homepage_enabled': 'false' '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 - name: Record custom 'Customise Website + Access Export' variables locally on AWX
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -29,9 +29,9 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertafter: '# Custom Settings Start' insertafter: '# Custom Settings Start'
with_dict: with_dict:
'sftp_auth_method': '"{{ sftp_auth_method }}"' 'awx_sftp_auth_method': '"{{ awx_sftp_auth_method }}"'
'sftp_password': '"{{ sftp_password }}"' 'awx_sftp_password': '"{{ awx_sftp_password }}"'
'sftp_public_key': '"{{ sftp_public_key }}"' 'awx_sftp_public_key': '"{{ awx_sftp_public_key }}"'
- name: Record custom 'Customise Website + Access Export' variables locally on AWX - name: Record custom 'Customise Website + Access Export' variables locally on AWX
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -41,8 +41,8 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertafter: '# Custom Settings Start' insertafter: '# Custom Settings Start'
with_dict: with_dict:
'customise_base_domain_website': '{{ customise_base_domain_website }}' 'awx_customise_base_domain_website': '{{ awx_customise_base_domain_website }}'
when: customise_base_domain_website is defined when: awx_customise_base_domain_website is defined
- name: Reload vars in matrix_vars.yml - name: Reload vars in matrix_vars.yml
include_vars: include_vars:
@ -54,28 +54,28 @@
template: template:
src: './roles/matrix-awx/surveys/configure_website_access_export.json.j2' 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' 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 - name: Copy new 'Customise Website + Access Export' survey.json to target machine
copy: copy:
src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_website_access_export.json' src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_website_access_export.json'
dest: '/matrix/awx/configure_website_access_export.json' dest: '/matrix/awx/configure_website_access_export.json'
mode: '0660' 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 - name: Save new 'Customise Website + Access Export' survey.json to the AWX tower, template
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
template: template:
src: './roles/matrix-awx/surveys/access_export.json.j2' src: './roles/matrix-awx/surveys/access_export.json.j2'
dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/access_export.json' 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 - name: Copy new 'Customise Website + Access Export' survey.json to target machine
copy: copy:
src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/access_export.json' src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/access_export.json'
dest: '/matrix/awx/access_export.json' dest: '/matrix/awx/access_export.json'
mode: '0660' 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 - name: Recreate 'Configure Website + Access Export' job template
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -97,7 +97,7 @@
tower_host: "https://{{ awx_host }}" tower_host: "https://{{ awx_host }}"
tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}"
validate_certs: yes validate_certs: yes
when: customise_base_domain_website is defined when: awx_customise_base_domain_website is defined
- name: Recreate 'Access Export' job template - name: Recreate 'Access Export' job template
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -119,9 +119,9 @@
tower_host: "https://{{ awx_host }}" tower_host: "https://{{ awx_host }}"
tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}" tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}"
validate_certs: yes 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: user:
name: sftp name: sftp
comment: SFTP user to set custom web files and access servers export comment: SFTP user to set custom web files and access servers export
@ -130,18 +130,18 @@
group: matrix group: matrix
password: '*' password: '*'
update_password: always 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: user:
name: sftp name: sftp
comment: SFTP user to set custom web files and access servers export comment: SFTP user to set custom web files and access servers export
shell: /bin/false shell: /bin/false
home: /home/sftp home: /home/sftp
group: matrix group: matrix
password: "{{ sftp_password | password_hash('sha512') }}" password: "{{ awx_sftp_password | password_hash('sha512') }}"
update_password: always update_password: always
when: sftp_password|length > 0 when: awx_sftp_password|length > 0
- name: Ensure group "sftp" exists - name: Ensure group "sftp" exists
group: group:
@ -153,7 +153,7 @@
name: sftp name: sftp
groups: sftp groups: sftp
append: yes 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) - 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: file:
@ -170,7 +170,7 @@
owner: matrix owner: matrix
group: matrix group: matrix
mode: '0770' mode: '0770'
when: customise_base_domain_website is defined when: awx_customise_base_domain_website is defined
- name: Ensure /chroot/export location exists - name: Ensure /chroot/export location exists
file: file:
@ -202,11 +202,11 @@
- name: Insert public SSH key into authorized_keys file - name: Insert public SSH key into authorized_keys file
lineinfile: lineinfile:
path: /home/sftp/.ssh/authorized_keys path: /home/sftp/.ssh/authorized_keys
line: "{{ sftp_public_key }}" line: "{{ awx_sftp_public_key }}"
owner: sftp owner: sftp
group: sftp group: sftp
mode: '0644' 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 - name: Remove any existing Subsystem lines
lineinfile: lineinfile:
@ -232,7 +232,7 @@
AllowTcpForwarding no AllowTcpForwarding no
PasswordAuthentication yes PasswordAuthentication yes
AuthorizedKeysFile /home/sftp/.ssh/authorized_keys 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 - name: Add SSH Match User section for password auth
blockinfile: blockinfile:
@ -245,7 +245,7 @@
X11Forwarding no X11Forwarding no
AllowTcpForwarding no AllowTcpForwarding no
PasswordAuthentication yes PasswordAuthentication yes
when: sftp_auth_method == "Password" when: awx_sftp_auth_method == "Password"
- name: Add SSH Match User section for publickey auth - name: Add SSH Match User section for publickey auth
blockinfile: blockinfile:
@ -258,7 +258,7 @@
X11Forwarding no X11Forwarding no
AllowTcpForwarding no AllowTcpForwarding no
AuthorizedKeysFile /home/sftp/.ssh/authorized_keys AuthorizedKeysFile /home/sftp/.ssh/authorized_keys
when: sftp_auth_method == "SSH Key" when: awx_sftp_auth_method == "SSH Key"
- name: Restart service ssh.service - name: Restart service ssh.service
service: service:

View file

@ -14,7 +14,7 @@
- name: Collect access token of Dimension user - name: Collect access token of Dimension user
shell: | 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/\"}//' 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 - name: Record Synapse variables locally on AWX
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -25,17 +25,17 @@
insertafter: '# Dimension Settings Start' insertafter: '# Dimension Settings Start'
with_dict: with_dict:
'matrix_dimension_enabled': '{{ matrix_dimension_enabled }}' '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 - name: Set final users list if users are defined
set_fact: set_fact:
ext_dimension_users_raw_final: "{{ ext_dimension_users_raw }}" awx_dimension_users_raw_final: "{{ awx_dimension_users_raw }}"
when: ext_dimension_users_raw|length > 0 when: awx_dimension_users_raw|length > 0
- name: Set final users list if no users are defined - name: Set final users list if no users are defined
set_fact: set_fact:
ext_dimension_users_raw_final: '@dimension:{{ matrix_domain }}' awx_dimension_users_raw_final: '@dimension:{{ matrix_domain }}'
when: ext_dimension_users_raw|length == 0 when: awx_dimension_users_raw|length == 0
- name: Remove Dimension Users - name: Remove Dimension Users
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -58,7 +58,7 @@
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
insertafter: '^matrix_dimension_admins:' insertafter: '^matrix_dimension_admins:'
line: ' - "{{ item }}"' 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 - name: Record Dimension Custom variables locally on AWX
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -68,7 +68,7 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertafter: '# Custom Settings Start' insertafter: '# Custom Settings Start'
with_dict: 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 - name: Save new 'Configure Dimension' survey.json to the AWX tower, template
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1

View file

@ -39,7 +39,7 @@
insertafter: '# Element Settings Start' insertafter: '# Element Settings Start'
with_dict: with_dict:
'matrix_client_element_welcome_logo': '{{ awx_matrix_client_element_welcome_logo }}' '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 - name: Remove custom logo locally on AWX if not defined
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -47,7 +47,7 @@
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
regexp: "^matrix_client_element_welcome_logo: " regexp: "^matrix_client_element_welcome_logo: "
state: absent 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 - name: Set custom logo link locally on AWX if defined
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -58,7 +58,7 @@
insertafter: '# Element Settings Start' insertafter: '# Element Settings Start'
with_dict: with_dict:
'matrix_client_element_welcome_logo_link': '{{ awx_matrix_client_element_welcome_logo_link }}' '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 - name: Remove custom logo link locally on AWX if not defined
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -66,7 +66,7 @@
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
regexp: "^matrix_client_element_welcome_logo_link: " regexp: "^matrix_client_element_welcome_logo_link: "
state: absent 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 - name: Set custom headline locally on AWX if defined
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -77,7 +77,7 @@
insertafter: '# Element Settings Start' insertafter: '# Element Settings Start'
with_dict: with_dict:
'matrix_client_element_welcome_headline': '{{ awx_matrix_client_element_welcome_headline }}' '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 - name: Remove custom headline locally on AWX if not defined
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -85,7 +85,7 @@
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
regexp: "^matrix_client_element_welcome_headline: " regexp: "^matrix_client_element_welcome_headline: "
state: absent 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 - name: Set custom text locally on AWX if defined
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -96,7 +96,7 @@
insertafter: '# Element Settings Start' insertafter: '# Element Settings Start'
with_dict: with_dict:
'matrix_client_element_welcome_text': '{{ awx_matrix_client_element_welcome_text }}' '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 - name: Remove custom text locally on AWX if not defined
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -115,7 +115,7 @@
insertafter: '# Element Settings Start' insertafter: '# Element Settings Start'
with_dict: with_dict:
'matrix_client_element_branding_welcomeBackgroundUrl': '{{ matrix_client_element_branding_welcomeBackgroundUrl }}' '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 - name: Save new 'Configure Element' survey.json to the AWX tower, template
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1

View file

@ -17,8 +17,8 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertafter: '# Synapse Extension Start' insertafter: '# Synapse Extension Start'
with_dict: with_dict:
'matrix_synapse_ext_password_provider_rest_auth_enabled': 'false' 'matrix_synapse_awx_password_provider_rest_auth_enabled': 'false'
when: ext_matrix_ma1sd_auth_store == 'Synapse Internal' when: awx_matrix_ma1sd_auth_store == 'Synapse Internal'
- name: Enable REST auth if using external LDAP/AD with ma1sd - name: Enable REST auth if using external LDAP/AD with ma1sd
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -28,9 +28,9 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertafter: '# Synapse Extension Start' insertafter: '# Synapse Extension Start'
with_dict: with_dict:
'matrix_synapse_ext_password_provider_rest_auth_enabled': 'true' 'matrix_synapse_awx_password_provider_rest_auth_enabled': 'true'
'matrix_synapse_ext_password_provider_rest_auth_endpoint': '"http://matrix-ma1sd:8090"' 'matrix_synapse_awx_password_provider_rest_auth_endpoint': '"http://matrix-ma1sd:8090"'
when: ext_matrix_ma1sd_auth_store == 'LDAP/AD' when: awx_matrix_ma1sd_auth_store == 'LDAP/AD'
- name: Remove entire ma1sd configuration extension - name: Remove entire ma1sd configuration extension
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -53,7 +53,7 @@
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
marker: "# {mark} ma1sd ANSIBLE MANAGED BLOCK" marker: "# {mark} ma1sd ANSIBLE MANAGED BLOCK"
insertafter: '# Start ma1sd Extension' 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 - name: Record ma1sd Custom variables locally on AWX
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -63,8 +63,8 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertbefore: '# Custom Settings Start' insertbefore: '# Custom Settings Start'
with_dict: with_dict:
'ext_matrix_ma1sd_auth_store': '{{ ext_matrix_ma1sd_auth_store }}' 'awx_matrix_ma1sd_auth_store': '{{ awx_matrix_ma1sd_auth_store }}'
'ext_matrix_ma1sd_configuration_extension_yaml': '{{ ext_matrix_ma1sd_configuration_extension_yaml.splitlines() | to_json }}' 'awx_matrix_ma1sd_configuration_extension_yaml': '{{ awx_matrix_ma1sd_configuration_extension_yaml.splitlines() | to_json }}'
no_log: True no_log: True
- name: Save new 'Configure ma1sd' survey.json to the AWX tower, template - name: Save new 'Configure ma1sd' survey.json to the AWX tower, template

View file

@ -26,21 +26,21 @@
'matrix_synapse_url_preview_enabled': '{{ matrix_synapse_url_preview_enabled }}' 'matrix_synapse_url_preview_enabled': '{{ matrix_synapse_url_preview_enabled }}'
'matrix_synapse_allow_guest_access': '{{ matrix_synapse_allow_guest_access }}' '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 delegate_to: 127.0.0.1
replace: replace:
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
regexp: "^matrix_synapse_auto_join_rooms: .*$" regexp: "^awx_matrix_synapse_auto_join_rooms: .*$"
replace: "matrix_synapse_auto_join_rooms: []" replace: "awx_matrix_synapse_auto_join_rooms: []"
when: matrix_synapse_auto_join_rooms_raw|length == 0 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 - name: If the raw inputs is not empty start constructing parsed auto_join_rooms list
set_fact: set_fact:
matrix_synapse_auto_join_rooms_array: |- awx_matrix_synapse_auto_join_rooms_array: |-
{{ matrix_synapse_auto_join_rooms_raw.splitlines() | to_json }} {{ awx_matrix_synapse_auto_join_rooms_raw.splitlines() | to_json }}
when: matrix_synapse_auto_join_rooms_raw|length > 0 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 delegate_to: 127.0.0.1
lineinfile: lineinfile:
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
@ -48,8 +48,8 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertafter: '# Synapse Settings Start' insertafter: '# Synapse Settings Start'
with_dict: with_dict:
"matrix_synapse_auto_join_rooms": "{{ matrix_synapse_auto_join_rooms_array }}" "awx_matrix_synapse_auto_join_rooms": "{{ awx_matrix_synapse_auto_join_rooms_array }}"
when: matrix_synapse_auto_join_rooms_raw|length > 0 when: awx_matrix_synapse_auto_join_rooms_raw|length > 0
- name: Record Synapse Shared Secret if it's defined - name: Record Synapse Shared Secret if it's defined
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -59,8 +59,8 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertafter: '# Synapse Settings Start' insertafter: '# Synapse Settings Start'
with_dict: with_dict:
'matrix_synapse_registration_shared_secret': '{{ ext_matrix_synapse_registration_shared_secret }}' 'matrix_synapse_registration_shared_secret': '{{ awx_matrix_synapse_registration_shared_secret }}'
when: ext_matrix_synapse_registration_shared_secret|length > 0 when: awx_matrix_synapse_registration_shared_secret|length > 0
- name: Record registations_require_3pid extra variable if true - name: Record registations_require_3pid extra variable if true
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -72,7 +72,7 @@
with_items: with_items:
- " registrations_require_3pid:" - " registrations_require_3pid:"
- " - email" - " - email"
when: ext_registrations_require_3pid|bool when: awx_registrations_require_3pid|bool
- name: Remove registrations_require_3pid extra variable if false - name: Remove registrations_require_3pid extra variable if false
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -85,7 +85,7 @@
with_items: with_items:
- " registrations_require_3pid:" - " registrations_require_3pid:"
- " - email" - " - email"
when: not ext_registrations_require_3pid|bool when: not awx_registrations_require_3pid|bool
- name: Remove URL Languages - name: Remove URL Languages
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -97,21 +97,21 @@
- name: Set URL languages default if raw inputs empty - name: Set URL languages default if raw inputs empty
set_fact: set_fact:
ext_url_preview_accept_language_default: 'en' awx_url_preview_accept_language_default: 'en'
when: ext_url_preview_accept_language_raw|length == 0 when: awx_url_preview_accept_language_raw|length == 0
- name: Set URL languages default if raw inputs not empty - name: Set URL languages default if raw inputs not empty
set_fact: set_fact:
ext_url_preview_accept_language_default: "{{ ext_url_preview_accept_language_raw }}" awx_url_preview_accept_language_default: "{{ awx_url_preview_accept_language_raw }}"
when: ext_url_preview_accept_language_raw|length > 0 when: awx_url_preview_accept_language_raw|length > 0
- name: Set URL languages if raw inputs empty - name: Set URL languages if raw inputs empty
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
lineinfile: lineinfile:
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
insertafter: '^ url_preview_accept_language:' insertafter: '^ url_preview_accept_language:'
line: " - {{ ext_url_preview_accept_language_default }}" line: " - {{ awx_url_preview_accept_language_default }}"
when: ext_url_preview_accept_language_raw|length == 0 when: awx_url_preview_accept_language_raw|length == 0
- name: Set URL languages if raw inputs not empty - name: Set URL languages if raw inputs not empty
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -119,8 +119,8 @@
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
insertafter: '^ url_preview_accept_language:' insertafter: '^ url_preview_accept_language:'
line: " - {{ item }}" line: " - {{ item }}"
with_items: "{{ ext_url_preview_accept_language_raw.splitlines() }}" with_items: "{{ awx_url_preview_accept_language_raw.splitlines() }}"
when: ext_url_preview_accept_language_raw|length > 0 when: awx_url_preview_accept_language_raw|length > 0
- name: Remove Federation Whitelisting 1 - name: Remove Federation Whitelisting 1
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -143,7 +143,7 @@
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
insertafter: '^matrix_synapse_configuration_extension_yaml: \|' insertafter: '^matrix_synapse_configuration_extension_yaml: \|'
line: " federation_domain_whitelist:" line: " federation_domain_whitelist:"
when: ext_federation_whitelist_raw|length > 0 when: awx_federation_whitelist_raw|length > 0
- name: Set Federation Whitelisting 2 - name: Set Federation Whitelisting 2
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -151,16 +151,16 @@
path: '{{ awx_cached_matrix_vars }}' path: '{{ awx_cached_matrix_vars }}'
insertafter: '^ federation_domain_whitelist:' insertafter: '^ federation_domain_whitelist:'
line: " - {{ item }}" line: " - {{ item }}"
with_items: "{{ ext_federation_whitelist_raw.splitlines() }}" with_items: "{{ awx_federation_whitelist_raw.splitlines() }}"
when: ext_federation_whitelist_raw|length > 0 when: awx_federation_whitelist_raw|length > 0
- name: Set ext_recaptcha_public_key to a 'public-key' if undefined - name: Set awx_recaptcha_public_key to a 'public-key' if undefined
set_fact: ext_recaptcha_public_key="public-key" set_fact: awx_recaptcha_public_key="public-key"
when: (ext_recaptcha_public_key is not defined) or (ext_recaptcha_public_key|length == 0) 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 - name: Set awx_recaptcha_private_key to a 'private-key' if undefined
set_fact: ext_recaptcha_private_key="private-key" set_fact: awx_recaptcha_private_key="private-key"
when: (ext_recaptcha_private_key is not defined) or (ext_recaptcha_private_key|length == 0) when: (awx_recaptcha_private_key is not defined) or (awx_recaptcha_private_key|length == 0)
- name: Record Synapse Extension variables locally on AWX - name: Record Synapse Extension variables locally on AWX
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -170,9 +170,9 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertbefore: '# Synapse Extension End' insertbefore: '# Synapse Extension End'
with_dict: with_dict:
' enable_registration_captcha': '{{ ext_enable_registration_captcha }}' ' enable_registration_captcha': '{{ awx_enable_registration_captcha }}'
' recaptcha_public_key': '{{ ext_recaptcha_public_key }}' ' recaptcha_public_key': '{{ awx_recaptcha_public_key }}'
' recaptcha_private_key': '{{ ext_recaptcha_private_key }}' ' recaptcha_private_key': '{{ awx_recaptcha_private_key }}'
- name: Record Synapse Custom variables locally on AWX - name: Record Synapse Custom variables locally on AWX
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
@ -182,11 +182,11 @@
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
insertafter: '# Custom Settings Start' insertafter: '# Custom Settings Start'
with_dict: with_dict:
'ext_federation_whitelist_raw': '{{ ext_federation_whitelist_raw.splitlines() | to_json }}' 'awx_federation_whitelist_raw': '{{ awx_federation_whitelist_raw.splitlines() | to_json }}'
'ext_url_preview_accept_language_default': '{{ ext_url_preview_accept_language_default.splitlines() | to_json }}' 'awx_url_preview_accept_language_default': '{{ awx_url_preview_accept_language_default.splitlines() | to_json }}'
'ext_enable_registration_captcha': '{{ ext_enable_registration_captcha }}' 'awx_enable_registration_captcha': '{{ awx_enable_registration_captcha }}'
'ext_recaptcha_public_key': '"{{ ext_recaptcha_public_key }}"' 'awx_recaptcha_public_key': '"{{ awx_recaptcha_public_key }}"'
'ext_recaptcha_private_key': '"{{ ext_recaptcha_private_key }}"' 'awx_recaptcha_private_key': '"{{ awx_recaptcha_private_key }}"'
- name: Save new 'Configure Synapse' survey.json to the AWX tower, template - name: Save new 'Configure Synapse' survey.json to the AWX tower, template
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1