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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are playbooks in ansible?

2


Describe the working of ansible.

2


What are the ansible modules? Explain the different types.

2


What is the use of ansible vaults?

3


What are ad-hoc commands? Give an example.

3


What are ansible vaults and why are they used?

3


How ansible different from the playbook?

1


What are the different components of ansible?

3


How to create encrypted files using ansible?

3


Why is ‘{{ }}’ notation used?

3


What is the method to check the inventory vars defined for the host?

2


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

2


How do I set the path or any other environment variable for a task?

3


Can you copy files recursively onto a target host? If yes, how?

3


What is ansible tower?

3