How can I display all the inventory vars defined for my host?
Answer Posted / Ashutosh Singh Chauhan
To display all the inventory variables for a specific host, you can use the `ansible` command with the `--json` flag and the `-i` flag to specify your inventory file. Here's an example:nn```bashn$ ansible -i inventory_file all --json | jq '.inventory_hosts[] | select(.name == "my_host") | .vars'"```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What’s the use of ansible?
Where does the configuration file live and what can I configure in it?
How can you access a list of ansible_variables?
List some advantages of using ansible.
How do I see a list of all of the ansible_ variables?
What is ansible role?
What is the use of ansible?
How do I access shell environment variables?
How do I generate crypted passwords for the user module?
How ansible works?
How can you handle different machines needing different user accounts or ports to log in with?
Can you write a simple playbook to install nginx on a host machine?
What is the ask_pass module in ansible?
What are ansible server requirements?
Give a comparison between ansible and puppet.