ansible command to list all known hosts

--list-hosts lists hosts that match a --limit. The input is the -i, inventory. Your inventory is a file named hosts, which doesn’t exist.

You need to create or generate an inventory file from somewhere. Ansible can’t intuit what your inventory is.

Leave a Comment