Logtree

Dear All,

I see that the ansible program has the option of saving it’s output in a logfile somewhere:
-t TREE, --tree=TREE log output to this directory

But ansible-playbook seems to miss such a feature.

I’d like to be able to have other people in our team review what my playbook session did (And vice-versa). Is there a proper way of doing so? Or should I invest some time in a callback plugin?

Thanks,
Mark

A callback plugin is the intended way to write a custom logger, yes.

The tree layout wouldn't really make sense for an entire playbook run.

Good, thats allright then.

Is there documentation anywhere about the callback plugin system?
I mean a bit more then: http://ansible.cc/docs/api.html?highlight=callback#callback-plugins ?

Or even this: http://jpmens.net/2012/09/11/watching-ansible-at-work-callbacks/?

Thank,
Mark

There are several live examples in addition to the API docs:

https://github.com/ansible/ansible/tree/devel/plugins/callbacks

Agreed but there not commented, and way above my python-skilzzz ( :wink: )

I’m a stinking old Linux admin with Bash skils, so I’ll be creating my callbacks in Bash, but I do not know how the whole thing works.
I mean, what do I do to have the callback run, and what get’s passed to it and it what form, etc??

Any other examples?

Thanks!
Mark

Comments, well, it's intended that you read the source and see where
the individual names come up if you need more understanding. They are
intentionally rather low level.

https://github.com/ansible/ansible/blob/devel/lib/ansible/callback_plugins/noop.py

It always runs automatically if in the proper directory. These are
configured either in your config file or you can just drop it in the
systems one.

Aaah, I missed that part. So these scripts, as long as they are available, get run anyway, no need for a special something in the playbook.

Thanks!
Mark