How do I see all the inventory vars defined for my host?
Answer / Rajendra Singh
To view all inventory variables defined for a host in Ansible, you can use the 'debug' module to print the hostvars. Here's an example playbook that does this:nn---
{"hosts":"hostname"n , "tasks":"
- name: Print Inventory Variables
debug: var=ansible_facts["{{ inventory_hostname }}"] "n
| Is This Answer Correct ? | 0 Yes | 0 No |
When to use {{}} ? How to interpolate variables or dynamic variable names?
When should you test playbooks and roles?
How to interpolate variables or dynamic variable names?
What is ansible tower?
Explain in detail about ad-hoc command?
What is ansible and what makes it stand out from the rest of the configuration management tools?
How can you access a list of ansible_variables?
How can one generate encrypted passwords for the user module?
How would you install ansible on a centos system?
How do I speed up management inside ec2?
What are the different components of ansible?
What is the use of ansible vaults?