Hi All,
I am using below slack callback configuration and getting below error. When i tried using the slack module instead of slack callback plugin, i am able to get the notification in my slack channel. But i want to use the slack callback plugin to get the ansible play over slack everytime if it is failed/successful.
Please provide your valuable inputs here in case if i am trying something wrong/missing some imp configuration. I have been testing this from last few days and asking experts in this forum to help me in resoving this issue.
Thanks in advance.
Below is the error when running the playbook.
PLAYBOOK: test.yml ****************
[WARNING]: Failure using method (v2_playbook_on_start) in callback plugin (<ansible.plugins.callback./usr/share/ansible/plugins/callback/slack.CallbackModule object at
0x7f3484454190>): ‘tags’
Callback Exception:
File “/usr/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py”, line 374, in send_callback
method(*new_args, **kwargs)
File “/usr/share/ansible/plugins/callback/slack.py”, line 136, in v2_playbook_on_start
tags = self.get_option(‘tags’)
File “/usr/lib/python2.7/site-packages/ansible/plugins/callback/init.py”, line 90, in get_option
return self._plugin_options[k]
PLAY [Main ABC Playbook] ******************************************************************************************************************************************
[WARNING]: Could not submit message to Slack: HTTP Error 403: Forbidden
my ansible.cfg is configured like below for slack callback plugin.
[defaults]
callback_whitelist = slack
[callback_slack]
channel = <#Myslackchannel>
username = ansible
webhook_url =
ansible --version
ansible 2.7.0.dev0
config file = /etc/ansible/roles/auto_os_patch/ansible.cfg
configured module search path = [u’/home/user1/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5 (default, Feb 20 2018, 09:19:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
I have also impoted prettytable which is one of the requirement of ansible slack callback plugin.
Python 2.7.5 (default, Feb 20 2018, 09:19:12)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
import prettytable
prettytable
<module ‘prettytable’ from ‘/usr/lib64/python2.7/site-packages/prettytable.pyc’>
Regards,
Vinod kumar