Skip to content

Instantly share code, notes, and snippets.

@strootman
Created November 24, 2015 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strootman/3ef88e206bd425aca50a to your computer and use it in GitHub Desktop.
Save strootman/3ef88e206bd425aca50a to your computer and use it in GitHub Desktop.
A way to dump all the vars for a host. Must be used with `--limit`, otherwise, last host wins.
---
- name: Dump all vars
hosts: all
tasks:
- name: Dump all vars
template: src=scripts/dump_vars.j2 dest=/tmp/ansible.all
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