Yes I tried it and it outputs json content for each task. Something like this:
`
TASK [create some file] ********************************************************
ok: [172.31.9.253 → localhost]
{“group”: “ubuntu”, “_ansible_no_log”: false, “_ansible_delegated_vars”: {“ansible_host”: “localhost”}, “changed”: false, “host”: “172.31.9.253”, “invocation”: {“module_args”: {“directory_mode”: null, “force”: false, “remote_src”: null, “path”: “/tmp/services_status.json.tmp”, “owner”: null, “follow”: true, “group”: null, “state”: null, “content”: null, “serole”: null, “diff_peek”: null, “setype”: null, “dest”: “/tmp/services_status.json.tmp”, “selevel”: null, “original_basename”: “services.j2”, “regexp”: null, “validate”: null, “src”: null, “seuser”: null, “recurse”: false, “delimiter”: null, “mode”: null, “backup”: null}}, “state”: “file”, “gid”: 1000, “mode”: “0664”, “diff”: {“after”: {“path”: “/tmp/services_status.json.tmp”}, “before”: {“path”: “/tmp/services_status.json.tmp”}}, “owner”: “ubuntu”, “path”: “/tmp/services_status.json.tmp”, “size”: 542, “uid”: 1000}
ok: [172.31.35.225 → localhost]
{“group”: “ubuntu”, “_ansible_no_log”: false, “_ansible_delegated_vars”: {“ansible_host”: “localhost”}, “changed”: false, “host”: “172.31.35.225”, “invocation”: {“module_args”: {“directory_mode”: null, “force”: false, “remote_src”: null, “path”: “/tmp/services_status.json.tmp”, “owner”: null, “follow”: true, “group”: null, “state”: null, “content”: null, “serole”: null, “diff_peek”: null, “setype”: null, “dest”: “/tmp/services_status.json.tmp”, “selevel”: null, “original_basename”: “services.j2”, “regexp”: null, “validate”: null, “src”: null, “seuser”: null, “recurse”: false, “delimiter”: null, “mode”: null, “backup”: null}}, “state”: “file”, “gid”: 1000, “mode”: “0664”, “diff”: {“after”: {“path”: “/tmp/services_status.json.tmp”}, “before”: {“path”: “/tmp/services_status.json.tmp”}}, “owner”: “ubuntu”, “path”: “/tmp/services_status.json.tmp”, “size”: 542, “uid”: 1000}
TASK [debug] *******************************************************************
…
`
This is not helpful to me as I only want json output and no thing in between, because in shell script I want to read this output and convert the output to json object.
Please let me know if I am not clear with my requirement.