These snippets will get you setup with sending slack messages in a jiffy from your ansible playbooks.
The Task
First we'll setup a simple wrapper task. Create a file called tasks/slack.yaml
. We'll use import_tasks
later to call this task.
The Playbook
Simply add the following block to your existing playbook(s). Notice how we pass vars
to our task wrapper (above).
See also
https://docs.ansible.com/ansible/latest/modules/slack_module.html