{{tag>ansible}} ====== 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 ====== * [[wiki:ansible_debug_one_variable|Ansible debug one variable]] * [[wiki:ansible_troubleshooting|ansible troubleshooting]] ====== References ====== * https://gryzli.info/2017/12/21/ansible-debug-print-variables/