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
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
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
to Ansible Project
in 2.8 ansible_play_name

----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages