I need help to configure the new notification playbook.
Already i written the play book and which i am getting the error,Can you have a look on it please.
---
- hosts: all
gather_facts: True
become: yes
tasks:
- name: Execute the Uptime command over Command module
register: uptimeoutput
command: "uptime"
- debug:
var: uptimeoutput.stdout_lines
- debug:
msg: "SELinux status on host {{ ansible_selinux.status }}"
- name: Add AWX Notifications Test
collections: [awx.awx]
vars:
default_values:
state: present
awx.awx.tower_notification:
- name: Add email notification
tower_notification:
name: email notification
notification_type: email
mail:
host: smtp.uat.igi.ig.local
port: 25
sender:
recipients:
-
use_tls: no
use_ssl: no
state: present
messages:
started:
message: "{{ '{{ job_friendly_name }}{{
job.id }} started' }}"
success:
message: "{{ '{{ job_friendly_name }} completed in {{ job.elapsed }} seconds' }}"
error:
message: "{{ '{{ job_friendly_name }} FAILED! Please look at {{ job.url }}' }}"
tower_config_file: "~/tower_cli.cfg"