How do you inspect the inventory Ansible actually parsed?
BeginnerConceptInventory
Answer
ansible-inventory -i inventory/ --graph # tree of groups and hosts
ansible-inventory -i inventory/ --graph --vars # include variables
ansible-inventory -i inventory/ --list # full JSON
ansible-inventory -i inventory/ --host web1 # merged vars for one host
ansible-inventory -i inventory/ --list --yaml
It shows the merged result, including dynamic sources, so it is the first thing to run when a host is not in the group you expect.
More on Inventory
What is an inventory and why does Ansible need one?BeginnerWhat are the INI and YAML inventory formats and how do they differ?BeginnerHow do you create groups of groups?BeginnerExplain host patterns: `:`, `:&`, `:!` and wildcards.IntermediateWhich connection variables can you set per host in inventory?BeginnerWhat are `group_vars` and `host_vars` directories?Intermediate