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?

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


Please Help Members By Posting Answers For Below Questions

What’s the use of ansible?

3


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

4


How can you access a list of ansible_variables?

4


List some advantages of using ansible.

3


How do I see a list of all of the ansible_ variables?

3


What is ansible role?

3


What is the use of ansible?

3


How do I access shell environment variables?

3


How do I generate crypted passwords for the user module?

4


How ansible works?

3


How can you handle different machines needing different user accounts or ports to log in with?

4


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

3


What is the ask_pass module in ansible?

3


What are ansible server requirements?

4


Give a comparison between ansible and puppet.

3