Accessing registered variables inside callback plugin

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

the ‘results’ you get on callback methods IS the what would be in the registered var for that task.

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