JSON log callback_plugin questions

113 views
Skip to first unread message

Peter M Souter

unread,
Aug 12, 2014, 10:46:10 AM8/12/14
to ansible...@googlegroups.com
Hello All!

I've made a basic callback_plugin for creating logs as json, check it out: https://github.com/petems/ansible-json

So far so good, it all works.

My plan is to a have a toggableable ability to write the logs to files on the system that ansible's running on (Current progress here: https://github.com/petems/ansible-json/tree/create_json_files).

Two questions:

1) How do I read playbook variables in the plugin? My plan is to have something like this in the playbook:

---
- hosts: all
  vars:
    json_log: true

But I cant figure out how to get this information when the plugin runs.

2) Is there an example of a callback_plugin that reads a config value from the ansible.cfg? I want to be able to set where the ansible json logs are set to by a config setting, rather than hardcode it to /var/log/ansible/hosts/json.

Thanks!

Regards

Michael DeHaan

unread,
Aug 12, 2014, 3:07:56 PM8/12/14
to ansible...@googlegroups.com
Hi, 

For callback plugin development questions, can you please post to ansible-devel?

Thank you!




--
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/8c6ff332-70b9-4c85-91e0-21bf42bde7cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages