Accessing registered variables inside callback plugin

37 views
Skip to first unread message

Abhishek R.

unread,
Jun 15, 2016, 7:06:22 AM6/15/16
to Ansible Project
Hi,

I have a simple playbook that registers some variables. And I have a mail callback plugin that sends out an email if a playbook run fails (runner_on_failed). How do I access the value of a registered variable from within the callback plugin, with the purpose of sending that value across in the email? 

I did see various discussions and examples of access hostvars and group vars from within the callback module. But didn't really find an example of accessing a registered variable.

Any examples or suggestions will be helpful. Thanks in advance.

Regards

Brian Coca

unread,
Jun 15, 2016, 11:42:31 AM6/15/16
to ansible...@googlegroups.com
the 'results' you get on callback methods IS the what would be in the registered var for that task.


----------
Brian Coca

Abhishek R.

unread,
Jun 20, 2016, 1:44:22 AM6/20/16
to Ansible Project
Thanks, but would it be available just for the task where it was registered? How do I access the value of the registered variable for a failure-callback of a subsequent task?

Regards
Reply all
Reply to author
Forward
0 new messages