Slack notifications with web-hook behind proxy

82 views
Skip to first unread message

Mukul Malhotra

unread,
Sep 27, 2019, 7:16:04 AM9/27/19
to Ansible Project
Hi,

I am trying to setup slack with through ansible but I am getting below error as,

Playbook:

- name: Send notification message via Slack
  slack:
    token: "MYToken/../../ Format"
    msg: '{{ inventory_hostname }} completed'
  delegate_to: localhost

Error:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to connect to hooks.slack.com at port 443: [Errno 8] nodename nor servname provided, or not known", "status": -1, "url": "https://hooks.slack.com/services/********"}


As I am assuming that above error is due to proxy https/http so kindly assist on the same to resolve my issue. 

Mukul

Kashish Sharma

unread,
Sep 28, 2019, 4:13:39 AM9/28/19
to ansible...@googlegroups.com
hi you can try this one.

- name: Send notification message via Slack
     slack:
      token: T9S6DSFFSDA/BJMG9DLTA/86HxbsssdrOkzlfCmNUYPyyo
      msg: '{{ inventory_hostname }}'
      color: good
      channel: '#test'
      username: 'System_Reboot_Required'
      icon_emoji: ':warning:'
      icon_url: ''
     when: reboot_required.stat.exists == true

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/769cede6-af20-48ed-831b-33c71fbe4231%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages