--list-hosts

The flag that prints exactly which hosts a pattern selects, without connecting to any of them or running anything.

In more detail

It works with both ansible and ansible-playbook. Running it before anything destructive answers the only question that matters: which machines am I about to change. It is the cheapest safety check in Ansible.

Example

ansible production --list-hosts

Related terms

Taught in

References

Certification courses