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.