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 |
Is it unsafe to bulk-set task arguments from a variable?
How can you connect other devices within ansible?
How to keep secret data in a playbook?
What are ansible vaults?
Compare ansible with chef.
When to use {{}} ? How to interpolate variables or dynamic variable names?
How can you handle different machines needing different user accounts or ports to log in with?
How do I see all the inventory vars defined for my host?
What is the ask_pass module in ansible?
What is the way to access shell environment variables in ansible?
What are playbooks in ansible?
What are ad-hoc commands? Give an example.