Sends notifications to Slack when a Docker container is created, started, stopped or destroyed.
Docker must be running (not handled by this role).
Required variables:
docker_slack_notifier_token
: Slack web-hook token.
Optional variables:
docker_slack_notifier_basedir
: Installation directorydocker_slack_notifier_channel
: Slack #channeldocker_slack_notifier_username
: Slack usernamedocker_slack_notifier_icon
: Slack :emoji: The parameters of a Docker event must match all of these to be notified (seedefaults/main.yml
for default values)docker_slack_notifier_eventmatch_action
: event action regexpdocker_slack_notifier_eventmatch_image
: image name regexpdocker_slack_notifier_eventmatch_container
: container name regexp
- hosts: all
roles:
- role: ome.docker
- role: ome.docker_slack_notifier
docker_slack_notifier_channel: "#notifications"
docker_slack_notifier_username: "Docker {{ ansible_hostname }}"
docker_slack_notifier_token: XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX