1

Current channel name has been changed. So, every time when we face this then we need to change the name in template too. So, I am planning to provide channel ID instead of channel name but template fails with channel ID. What possibly could be the reason? Below is my code:

---

- name:  Sending slack notification
  hosts: localhost
  gather_facts: false
  become: false
  tasks:
    - slack:
        channel: "{{SLACK_CHANNEL}}"
        token: "{{SLACK_TOKEN}}"
        username: "Ansible - Bot"
        icon_url: "https://docs.ansible.com/favicon.ico"
        msg: "@here xyz"`

Below is the way how I am providing Slack channel ID via ansible template:

SLACK_CHANNEL: "abc123"

I have checked slack documentation and couldn't find out the reason. As template is working with channel name so hard to figure out.

Carlos Monroy Nieblas
  • 2,225
  • 2
  • 16
  • 27
Raining
  • 11
  • 2
  • 1
    "_What possibly could be the reason?_" That kind of functionality might not be implemented in [`ansible-collections/community.general/blob/main/plugins/modules/slack.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/slack.py). – U880D Jan 13 '23 at 16:35
  • What method are you calling? You're saying the script is failing, what error are you getting? – sandra Jan 16 '23 at 21:36

0 Answers0