# deployment notifications - for all cases - OK and failed.

**URL:** <https://forum.ansible.com/t/deployment-notifications-for-all-cases-ok-and-failed/23799>\
**Category:** Ansible Project\
**Created:** [February 22, 2017, 6:05pm UTC](https://forum.ansible.com/t/deployment-notifications-for-all-cases-ok-and-failed/23799 "2017-02-22T18:05:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![epiq\_sty](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@epiq\_sty](https://forum.ansible.com/u/epiq_sty)\
**Post date:** [February 22, 2017, 6:05pm UTC](https://forum.ansible.com/t/deployment-notifications-for-all-cases-ok-and-failed/23799/1 "2017-02-22T18:05:13Z")

</div>

Hello!

Can you please advice the best way - for sending notifications , if role failed on several hosts ?

We have implemented slack notifications about successfully deployed hosts, but how we can get list of failed hosts , and also send notifications ?

Seem’s if host failed, on last step we just not have information about it.

Here is out role:

---

<div class="post-metadata">

**Author:** ![Stankovic\_Marko](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@Stankovic\_Marko](https://forum.ansible.com/u/Stankovic_Marko)\
**Post date:** [February 23, 2017, 10:36am UTC](https://forum.ansible.com/t/deployment-notifications-for-all-cases-ok-and-failed/23799/2 "2017-02-23T10:36:53Z")

</div>

Hi,

Maybe Slack callback plugin would work better for you?

Enable it by adding slack to the callback\_whitelist in /etc/ansible/ansible.cfg  
[http://docs.ansible.com/ansible/intro\_configuration.html#callback-whitelist](http://docs.ansible.com/ansible/intro_configuration.html#callback-whitelist)

Here's documentation from the plugin itself:  
[https://github.com/ansible/ansible/pull/13408/files](https://github.com/ansible/ansible/pull/13408/files)  
&nbsp;&nbsp;&nbsp;&nbsp;This is an ansible callback plugin that sends status  
&nbsp;&nbsp;&nbsp;&nbsp;updates to a Slack channel during playbook execution.

&nbsp;&nbsp;&nbsp;&nbsp;This plugin makes use of the following environment variables:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SLACK\_WEBHOOK\_URL (required): Slack Webhook URL  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SLACK\_CHANNEL (optional): Slack room to post in. Default: #ansible  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SLACK\_USERNAME (optional): Username to post as. Default: ansible  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SLACK\_INVOCATION (optional): Show command line invocation  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;details. Default: False

&nbsp;&nbsp;&nbsp;&nbsp;Requires:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prettytable  
CONFIDENTIALITY NOTICE: This message is the property of International Game Technology PLC and/or its subsidiaries and may contain proprietary, confidential or trade secret information. This message is intended solely for the use of the addressee. If you are not the intended recipient and have received this message in error, please delete this message from your system. Any unauthorized reading, distribution, copying, or other use of this message or its attachments is strictly prohibited.

---

<div class="post-metadata">

**Author:** ![epiq\_sty](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@epiq\_sty](https://forum.ansible.com/u/epiq_sty)\
**Post date:** [February 28, 2017, 2:24pm UTC](https://forum.ansible.com/t/deployment-notifications-for-all-cases-ok-and-failed/23799/3 "2017-02-28T14:24:56Z")

</div>

Thanks,

I have tried, but got :

`  
[WARNING]: Could not submit message to Slack: HTTP Error 404: Not Found

`

error

Can you please advise, what else can be wrong here?

$ source .slack  
$ more .slack  
`  
SLACK\_WEBHOOK\_URL=[https://hooks.slack.com/services/aaa/bbb/ccc](https://hooks.slack.com/services/aaa/bbb/ccc)  
export SLACK\_WEBHOOK\_URL

`$ grep slack ansible.cfg`  
callback\_whitelist = slack  
`

---

<div class="post-metadata">

**Author:** ![epiq\_sty](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@epiq\_sty](https://forum.ansible.com/u/epiq_sty)\
**Post date:** [March 9, 2017, 2:07pm UTC](https://forum.ansible.com/t/deployment-notifications-for-all-cases-ok-and-failed/23799/4 "2017-03-09T14:07:11Z")

</div>

I’ve got the reason of 404 error. Seem’s that

- SLACK\_CHANNEL (optional): Slack room to post in. Default: #ansible

is not optional - as we have not special #ansible channel in our slack , we use **another** channel for testing deploys notification.

So callback start sending messages to slack only after specifying **another** channel via env.

It seem’s strange, because SLACK\_WEBHOOK\_URL at fact issued to some default channel, but if it’s not #ansible - you will get such 404 error.
