How do you inspect the inventory structure and a host's variables?
BeginnerProductionRapid-Fire Commands
Answer
ansible-inventory -i inventories/prod --graph # group tree
ansible-inventory -i inventories/prod --graph --vars # tree with variables
ansible-inventory -i inventories/prod --host web01 --yaml
ansible-inventory -i inventories/prod --list > inv.json # full JSON dump
The first check whenever a dynamic inventory or keyed_groups change is made.
More on Rapid-Fire Commands
How do you see which hosts a playbook would run against, without running it?BeginnerHow do you list the tasks and tags a playbook contains?BeginnerHow do you restart a service on a group with an ad-hoc command?BeginnerHow do you resume a playbook from a specific task or step through it?BeginnerHow do you re-run a playbook only on the hosts that failed?IntermediateHow do you check the value a variable resolves to on a specific host?Intermediate