Integrating with third-party services
Although you may be running the playbooks yourself, it’s a good idea to keep a log of your playbook run or update other team members or departments with the results. Ansible has several modules that allow you to work with third-party services to provide real-time notifications.
Let’s start by looking at Slack.
Slack
Slack has rapidly become the preferred option for team-based collaboration services across different IT departments. One key benefit of Slack is its support for third-party applications via its App Directory; Ansible supports Slack Incoming Webhooks via the community.general.slack
module.
Remember, you can install the community.general
collection if you don’t have it installed by running the following command:
$ ansible-galaxy collection install community.general
Before we look at the Ansible code, we should quickly discuss how you create a Slack App and enable webhooks.
First, you must make...