commands.sh

ansible-inventory

all

Display or dump an Ansible inventory. See also: `ansible`.

More info →

Options (2)

-i, --inventory-fileboolean

Display a custom inventory

Example: ansible-inventory --list {{[-i|--inventory-file]}} {{path/to/file_or_script_or_directory}}
-y, --yamlboolean

Display the default inventory in YAML

Example: ansible-inventory --list {{[-y|--yaml]}}

Examples (4)

Display the default inventory

Display a custom inventory

ansible-inventory --list [-i|--inventory-file] path/to/file_or_script_or_directory

Display the default inventory in YAML

ansible-inventory --list [-y|--yaml]

Dump the default inventory to a file

ansible-inventory --list --output path/to/file
made by @shridhargupta | data from tldr-pages