custom callback plugin for AWX

Hi ,

I am trying to get back o/p as a json so I am using json callback pluugin. My playbook str:

admin$ ls
README.md ansible.cfg callback_plugins test.yml

also ansible.cfg

admin$ cat ansible.cfg
[defaults]
callback_plugins = ./callback_plugins
callback_whitelist = json
stdout_callback = json
show_custom_stats = no

I have included json plugin inside the callback_plugins directory

callback_plugins admin$ ls
json.py json.pyc

However when i launch the playbook o/p doesnot appear as json. Any ideas ?

Thanks

You could try to SSH into your task container, and install ansible-runner from my custom branch which tries to enable this:

https://github.com/ansible/ansible-runner/pull/412

pip install git+git://github.com/alancoding/ansible-runner.git@stdout_callback

It would be nice to get this into a release soon, but this is all relatively recent.

I’m not a fan of the json stdout callback plugin specifically. It delays all output to the end, and the event data is going to be all screwy because of that, but it should be functional. There are some others which are good, and I’m settled on “selective” as the most useful one practically. I can also see the argument for YAML.

@arominge@redhat.com Do we need to make any other changes? i installed your custom branch still unable to use call back

can you help here