2021-10-10 05:23:49 +00:00
|
|
|
---
|
2021-08-13 08:05:57 +00:00
|
|
|
|
|
|
|
- name: Record Mailer variables locally on AWX
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
lineinfile:
|
|
|
|
path: '{{ awx_cached_matrix_vars }}'
|
|
|
|
regexp: "^#? *{{ item.key | regex_escape() }}:"
|
|
|
|
line: "{{ item.key }}: {{ item.value }}"
|
|
|
|
insertafter: '# Email Settings Start'
|
|
|
|
with_dict:
|
|
|
|
'matrix_mailer_relay_use': '{{ matrix_mailer_relay_use }}'
|
|
|
|
|
|
|
|
- name: Save new 'Configure Email Relay' survey.json to the AWX tower, template
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
template:
|
|
|
|
src: 'roles/matrix-awx/surveys/configure_email_relay.json.j2'
|
|
|
|
dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_email_relay.json'
|
|
|
|
|
|
|
|
- name: Copy new 'Configure Email Relay' survey.json to target machine
|
|
|
|
copy:
|
|
|
|
src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_email_relay.json'
|
|
|
|
dest: '/matrix/awx/configure_email_relay.json'
|
|
|
|
mode: '0660'
|
|
|
|
|
|
|
|
- name: Recreate 'Configure Email Relay' job template
|
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
awx.awx.tower_job_template:
|
|
|
|
name: "{{ matrix_domain }} - 1 - Configure Email Relay"
|
|
|
|
description: "Enable MailGun relay to increase verification email reliability."
|
|
|
|
extra_vars: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/extra_vars.json') }}"
|
|
|
|
job_type: run
|
|
|
|
job_tags: "start,setup-mailer"
|
|
|
|
inventory: "{{ member_id }}"
|
|
|
|
project: "{{ member_id }} - Matrix Docker Ansible Deploy"
|
|
|
|
playbook: setup.yml
|
|
|
|
credential: "{{ member_id }} - AWX SSH Key"
|
|
|
|
survey_enabled: true
|
|
|
|
survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_email_relay.json') }}"
|
2022-02-05 20:32:54 +00:00
|
|
|
become_enabled: true
|
2021-08-13 08:05:57 +00:00
|
|
|
state: present
|
|
|
|
verbosity: 1
|
2021-10-01 10:56:38 +00:00
|
|
|
tower_host: "https://{{ awx_host }}"
|
|
|
|
tower_oauthtoken: "{{ awx_session_token.ansible_facts.tower_token.token }}"
|
2022-02-05 20:32:54 +00:00
|
|
|
validate_certs: true
|