Dump Variables - BROKEN

25 views
Skip to first unread message

Andy L

unread,
May 27, 2016, 11:21:52 AM5/27/16
to Ansible Project
Prior to 2.0, I used a task that dumped Ansible variables to an output file using a template.

This technique was super valuable for debugging.

The template looked like this:

HOST Variables ("hostvars"):
--------------------------------
{{ hostvars | to_nice_json }}

Module Variables ("vars"):
--------------------------------
{{ vars | to_nice_json }}


In 2.0 and 2.1, these no longer work.

Questions:
1) Can anyone post a workaround for these bugs?
2) By now Ansible should be mature.  How did this regressions not get caught?  Is Ansible tested?

J Hawkesworth

unread,
May 27, 2016, 11:34:14 AM5/27/16
to Ansible Project
I usually just run something like this:

ansible -m debug -a "var=hostvars['interesting_host']" localhost -i test_inventory

Hope this helps,

Jon
Reply all
Reply to author
Forward
0 new messages