ansible-inventory

The command that shows how Ansible parsed the inventory, as a tree of groups or as the resolved variables for one host.

In more detail

--graph draws groups and hosts as a tree, --host <name> prints every variable that applies to that host after merging all sources, and --list prints everything as JSON. When an inventory surprises you, ask this command what it read before rereading the files.

Examples

ansible-inventory --graph
ansible-inventory --host web1.example.com

Related terms

Taught in

References

Certification courses