tower_notification – create, update, or destroy Ansible Tower notification¶
New in version 2.8.
Synopsis¶
- Create, update, or destroy Ansible Tower notifications. See https://www.ansible.com/tower for an overview.
Requirements¶
The below requirements are needed on the host that executes this module.
- ansible-tower-cli >= 3.0.2
Parameters¶
Notes¶
Note
- If no config_file is provided we will attempt to use the tower-cli library defaults to find your Tower host information.
- config_file should contain Tower configuration in the following format host=hostname username=username password=password
Examples¶
- name: Add Slack notification
tower_notification:
name: slack notification
notification_type: slack
channels:
- general
token: cefda9e2be1f21d11cdd9452f5b7f97fda977f42
state: present
tower_config_file: "~/tower_cli.cfg"
- name: Add webhook notification
tower_notification:
name: webhook notification
notification_type: webhook
url: http://www.example.com/hook
headers:
X-Custom-Header: value123
state: present
tower_config_file: "~/tower_cli.cfg"
- name: Add email notification
tower_notification:
name: email notification
notification_type: email
username: user
password: s3cr3t
sender: [email protected]
recipients:
- [email protected]
host: smtp.example.com
port: 25
use_tls: no
use_ssl: no
state: present
tower_config_file: "~/tower_cli.cfg"
- name: Add twilio notification
tower_notification:
name: twilio notification
notification_type: twilio
account_token: a_token
account_sid: a_sid
from_number: '+15551112222'
to_numbers:
- '+15553334444'
state: present
tower_config_file: "~/tower_cli.cfg"
- name: Add PagerDuty notification
tower_notification:
name: pagerduty notification
notification_type: pagerduty
token: a_token
subdomain: sub
client_name: client
service_key: a_key
state: present
tower_config_file: "~/tower_cli.cfg"
- name: Add HipChat notification
tower_notification:
name: hipchat notification
notification_type: hipchat
token: a_token
message_from: user1
api_url: https://hipchat.example.com
color: red
rooms:
- room-A
notify: yes
state: present
tower_config_file: "~/tower_cli.cfg"
- name: Add IRC notification
tower_notification:
name: irc notification
notification_type: irc
nickname: tower
password: s3cr3t
targets:
- user1
port: 8080
server: irc.example.com
use_ssl: no
state: present
tower_config_file: "~/tower_cli.cfg"
- name: Delete notification
tower_notification:
name: old notification
notification_type: email
state: absent
tower_config_file: "~/tower_cli.cfg"
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Samuel Carpentier (@samcarpentier)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.