Skip to content

Instantly share code, notes, and snippets.

@e-minguez
Created November 7, 2018 14:35
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 e-minguez/e15ba63879be278358c892807f69a87a to your computer and use it in GitHub Desktop.
Save e-minguez/e15ba63879be278358c892807f69a87a to your computer and use it in GitHub Desktop.
Dump variables
---
# To be used as:
# ansible-playbook --user openshift -i /usr/share/ansible/openshift-ansible/playbooks/openstack/inventory.py -i inventory dump.yml
- name: Dump debug info
hosts: all
become: yes
tasks:
- name: Print some debug information
vars:
msg: |
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 }}
debug:
msg: "{{ msg.split('\n') }}"
tags: debug_info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment