Howto add a task from a callback

what is the right way to add a task to the end of a playbook from a callback

i need to add a task based on an if in the callback “playbook_on_start”

can you give me an example of an simlpe command taks like echo “hello” (i dont need vars)

Thanks!

callbacks have no influence on playbooks, they are to handle output
from plays/tasks, information only goes in one direction.

if you need a conditional task, put it int the play

hmmm, code do no look “read only”

and how can add a task, without adding it to >100 playbooks

write an own “ansible-playbook” wrapper?

is there any better docs than:
http://docs.ansible.com/developing_api.html

what are you trying to accomplish? what is this task for?

logging on server which user, ran which playbook, when

Ansible already writes to syslog on the target machines also you can
turn on a more detail ansible log on the 'master' in ansible.cfg, In
general I would advice using a callback that writes to syslog (there
is an example in the repo, but it does json/syslog). For your case, if
you just want play name and user, it might be worth patching the
existing logging to add that information.

thanks

sounds like patching “log” is the best way