Dynamic callback

37 views
Skip to first unread message

DomaNitro

unread,
May 15, 2014, 3:51:10 AM5/15/14
to ansible...@googlegroups.com
Hey,

Is it possible to have play set a callback or that has to be done before the execution ? 

Michael DeHaan

unread,
May 15, 2014, 7:28:40 AM5/15/14
to ansible...@googlegroups.com
Ansible callbacks are not set by plays, they are loaded by being in the callback path prior to starting.

The path callbacks are searched for in is determined by ansible.cfg.

I think it may be interesting to discuss your fuctional use case as there may be a better way to achieve what you are looking for?


On Thu, May 15, 2014 at 3:51 AM, DomaNitro <adham...@gmail.com> wrote:
Hey,

Is it possible to have play set a callback or that has to be done before the execution ? 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/eb591efb-0ff1-44f0-8167-ef6f5f8767c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

DomaNitro

unread,
May 15, 2014, 9:30:47 AM5/15/14
to ansible...@googlegroups.com
Thats what i do at the moment, but  the idea is to set callback based on some variable that will then selectively enable callback or not during the execution of a play.  So for examples on development deployment we do not need callback functionality on production we might need or while debugging.  

I have not digged into the code but i think the hooks are done before execution and might make my request hard to achieve easily. 

Michael DeHaan

unread,
May 15, 2014, 5:49:35 PM5/15/14
to ansible...@googlegroups.com
"but  the idea is to set callback based on some variable that will then selectively enable callback or not during the execution of a play"

You could do some checks in the body of the callback functions that make the callbacks a no-op.




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages