Module Output Includes host and status...

14 views
Skip to first unread message

Matthew Kettlewell

unread,
Oct 12, 2015, 9:14:03 AM10/12/15
to Ansible Project

Is there a way to have the output of a module on the command line be a pure JSON object?


$ ansible localhost
-m setup | head
localhost | SUCCESS => {
   
"ansible_facts": {
       
"ansible_all_ipv4_addresses": [
...
...



ie, removing the 'localhost | SUCCESS =>' portion?


I'm sure can be done, since I've seen it referenced so often, but for the life of me, I can't figure out what needs to change.


Thanks






Brian Coca

unread,
Oct 23, 2015, 7:46:41 PM10/23/15
to Ansible Project
you can filter it out with awk/sed or use a custom callback that does
it directly.
Reply all
Reply to author
Forward
0 new messages