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

How ansible works?

1 Answers  


What are ad-hoc commands? Give an example.

1 Answers  


What is ansible role?

1 Answers  


How does configuration management is help an organization?

1 Answers  


Talk about ansible architecture.

1 Answers  


What are the ansible modules? Explain the different types.

1 Answers  


What are playbooks in ansible?

1 Answers  


Explain the concept behind infrastructure as code (iac).

1 Answers  


How can one generate encrypted passwords for the user module?

1 Answers  


How do I keep secret data in my playbook?

1 Answers  


How to keep secret data in a playbook?

1 Answers  


Why are you attracted to science and science fiction?

0 Answers  


Categories