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 do I see all the inventory vars defined for my host?



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

Post New Answer

More Ansible Interview Questions

Is it unsafe to bulk-set task arguments from a variable?

1 Answers  


How can you connect other devices within ansible?

1 Answers  


How to keep secret data in a playbook?

1 Answers  


What are ansible vaults?

1 Answers  


Compare ansible with chef.

1 Answers  


When to use {{}} ? How to interpolate variables or dynamic variable names?

1 Answers  


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

1 Answers  


How do I see all the inventory vars defined for my host?

1 Answers  


What is the ask_pass module in ansible?

1 Answers  


What is the way to access shell environment variables in ansible?

1 Answers  


What are playbooks in ansible?

1 Answers  


What are ad-hoc commands? Give an example.

1 Answers  


Categories