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

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

1 Answers  


When should you test playbooks and roles?

1 Answers  


How to interpolate variables or dynamic variable names?

1 Answers  


What is ansible tower?

1 Answers  


Explain in detail about ad-hoc command?

1 Answers  


What is ansible and what makes it stand out from the rest of the configuration management tools?

1 Answers  


How can you access a list of ansible_variables?

1 Answers  


How can one generate encrypted passwords for the user module?

1 Answers  


How would you install ansible on a centos system?

1 Answers  


How do I speed up management inside ec2?

1 Answers  


What are the different components of ansible?

1 Answers  


What is the use of ansible vaults?

1 Answers  


Categories