Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Mudpuppy12/a495323d5e77141bf42d64abd276474e to your computer and use it in GitHub Desktop.
Save Mudpuppy12/a495323d5e77141bf42d64abd276474e to your computer and use it in GitHub Desktop.
ansible debug
---
- hosts: localhost
gather_facts: 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