ansible-inventory Command Examples

Display or dump an Ansible inventory. See also: ansible. More information: https://docs.ansible.com/ansible/latest/cli/ansible-inventory.html.

ansible-inventory --list

ansible-inventory --list --inventory {{path/to/file_or_script_or_directory}}

ansible-inventory --list --yaml

ansible-inventory --list --output {{path/to/file}}