Slack notifications with web-hook behind proxy

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](http://hooks.slack.com/) at port 443: [Errno 8] nodename nor servname provided, or not known", "status": -1, "url": "[https://hooks.slack.com/services/********](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

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