refs #8025 send test email to AWX user email if defined, facts improved and renamed to debug
This commit is contained in:
parent
7131a80cc7
commit
f9921de0f0
|
@ -0,0 +1,20 @@
|
||||||
|
- name: Gather facts from host and print variables
|
||||||
|
hosts: all
|
||||||
|
gather_facts: yes
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: Print ansible facts
|
||||||
|
tags: facts
|
||||||
|
debug:
|
||||||
|
var: ansible_facts
|
||||||
|
|
||||||
|
- name: Print all variables
|
||||||
|
tags: vars
|
||||||
|
debug:
|
||||||
|
var: vars
|
||||||
|
|
||||||
|
- name: Print variable value
|
||||||
|
tags: var
|
||||||
|
when: var_name is defined
|
||||||
|
debug:
|
||||||
|
msg: "{{ var_name }}: {{ lookup('vars', var_name, default='undefined') }}"
|
|
@ -1,10 +0,0 @@
|
||||||
- name: Gather facts from host and print all variables
|
|
||||||
hosts: all
|
|
||||||
gather_facts: yes
|
|
||||||
tasks:
|
|
||||||
- name: Print all variables
|
|
||||||
debug:
|
|
||||||
var: vars
|
|
||||||
- name: Print variable value
|
|
||||||
debug:
|
|
||||||
msg: "Variable: {{ ansible_fqdn }}"
|
|
|
@ -1,6 +1,7 @@
|
||||||
vn_env: lab
|
vn_env: lab
|
||||||
vn_first_time: false
|
vn_first_time: false
|
||||||
vn_witness_checked: false
|
vn_witness_checked: false
|
||||||
|
send_test_email: true
|
||||||
deb_packages:
|
deb_packages:
|
||||||
- https://apt.verdnatura.es/pool/main/v/vn-host/vn-apt-source_3.0.1_all.deb
|
- https://apt.verdnatura.es/pool/main/v/vn-host/vn-apt-source_3.0.1_all.deb
|
||||||
- https://apt.verdnatura.es/pool/main/v/vn-host/vn-host_3.0.1_all.deb
|
- https://apt.verdnatura.es/pool/main/v/vn-host/vn-host_3.0.1_all.deb
|
||||||
|
|
|
@ -27,7 +27,11 @@
|
||||||
- name: Force execution of handlers immediately
|
- name: Force execution of handlers immediately
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
- name: Sending mail to verify relay host configuration works
|
- name: Sending mail to verify relay host configuration works
|
||||||
|
when: >
|
||||||
|
exim_config.changed
|
||||||
|
and send_test_email
|
||||||
|
and awx_user_email is defined
|
||||||
|
and awx_user_email | length > 0
|
||||||
shell: >
|
shell: >
|
||||||
sleep 2; echo "If you see this message, relayhost on {{ ansible_fqdn }} has been configured correctly." \
|
sleep 2; echo "If you see this message, relayhost on {{ ansible_fqdn }} has been configured correctly." \
|
||||||
| mailx -s "Relayhost test for {{ ansible_fqdn }}" "{{ sysadmin_mail }}"
|
| mailx -s "Relayhost test for {{ ansible_fqdn }}" "{{ awx_user_email }}"
|
||||||
when: exim_config.changed
|
|
||||||
|
|
Loading…
Reference in New Issue