Skip to content

Instantly share code, notes, and snippets.

@sshnaidm
Created September 21, 2016 06:17
Show Gist options
  • Save sshnaidm/fce5868e8db5b83c17cf12f6a0f1cd9f to your computer and use it in GitHub Desktop.
Save sshnaidm/fce5868e8db5b83c17cf12f6a0f1cd9f to your computer and use it in GitHub Desktop.
dump all ansible variables
tasks:
- name: Dump all vars
action: template src=templates/dumpall.j2 dest=/tmp/ansible.all
dumpall.j2:
Module Variables ("vars"):
--------------------------------
{{ vars | to_nice_json }}
Environment Variables ("environment"):
--------------------------------
{{ environment | to_nice_json }}
GROUP NAMES Variables ("group_names"):
--------------------------------
{{ group_names | to_nice_json }}
GROUPS Variables ("groups"):
--------------------------------
{{ groups | to_nice_json }}
HOST Variables ("hostvars"):
--------------------------------
{{ hostvars | to_nice_json }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment