User Tools

Site Tools


wiki:ansible_debug_all_variables

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

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki