How can i retrieve playbook name, play name and task name in a playbook?
18 views
Skip to first unread message
Ankit
unread,
May 20, 2019, 3:17:23 AM5/20/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Is there a way i can retrieve the currently used playbook name, currently running play and task name using playbook rules? I need these 3 info to send them as a parameter for an external python script which would print a message using these 3 values so that the end users are aware of what task, playbook and play has resulted in that particular message. Is there a way i can retrieve these info during runtime in a playbook?
Regards,
Ankit
Kai Stian Olstad
unread,
May 20, 2019, 1:59:01 PM5/20/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
This information is not available for a task in a play.
But I belive you have access to all this information inside a callback plugin, maybe you can write your own plugin to do what you want.
--
Kai Stian Olstad
Brian Coca
unread,
May 21, 2019, 2:13:06 PM5/21/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message