Ansible role which provides an email (jabber, slack) notifications
notify_enabled: yes
notify_message: "[{{inventory_hostname}}] has been updated by {{ansible_ssh_user}} on {{ansible_date_time.iso8601}}"
notify_mail_to: ""
notify_mail_cc: ""
notify_mail_from: ansible@{{inventory_hostname}}
notify_mail_host: localhost
notify_mail_port: 25
notify_mail_attach: ""
notify_mail_shell: "" # Copy output from shell command as message body
notify_jabber_to: ""
notify_jabber_user: ""
notify_jabber_host: ""
notify_jabber_port: 5223
notify_jabber_password: ""
notify_slack_webhook: ""
notify_slack_username: ansible
notify_slack_icon: ":rocket:"
notify_slack_channel:
Add Stouts.notify
to your roles and set vars in your playbook file.
Example:
- hosts: all
roles:
- Stouts.postfix
- Stouts.notify
vars:
# Setup postfix
postfix_smtp_sasl_user: [email protected]
postfix_smtp_sasl_password: mypassword
# Setup notify
notify_mail_to: [email protected]
notify_mail_attach: /path/to/changelog
Licensed under the MIT License. See the LICENSE file for details.
Are welcome!