wiki:ansible_debug_all_variables
Table of Contents
Ansible debug all variables
Add this to playbook and comment any roles mentioned there.
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
Tested on
- ansible 2.9.6
See also
References
wiki/ansible_debug_all_variables.txt · Last modified: 2024/06/10 11:06 by antisa