ansible-inventory

Display or dump an Ansible inventory.

TLDR

Display the default inventory

$ ansible-inventory --list
copy

Display a custom inventory

$ ansbile-inventory --list --inventory [path/to/file_or_script_or_directory]
copy

Display the default inventory in YAML

$ ansible-inventory --list --yaml
copy

Dump the default inventory to a file

$ ansible-inventory --list --output [path/to/file]
copy

Copied to clipboard
gala