Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can I display all the inventory vars defined for my host?



How can I display all the inventory vars defined for my host?..

Answer / 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

More Ansible Interview Questions

What’s the use of ansible?

1 Answers  


When should I use {{ }}? Also, how to interpolate variables or dynamic variable names

1 Answers  


What is ansible role and how are they different from the playbook?

1 Answers  


Explain a few of the basic terminologies or concepts in ansible.

1 Answers  


How to create encrypted files using ansible?

1 Answers  


What is ansible task?

1 Answers  


How do I submit a change to the documentation?

1 Answers  


How would you install ansible on a centos system?

1 Answers  


Can you write a simple playbook to install nginx on a host machine?

1 Answers  


How do I copy files recursively onto a target host?

0 Answers  


Where does the configuration file live and what can I configure in it?

1 Answers  


Can you build your own modules with ansible?

1 Answers  


Categories