How to select hosts you wish to manage
See also
Ansible works against multiple systems in your infrastructure at the same time. It does this by selecting portions of systems listed in Ansible’s inventory file, which defaults to /etc/ansible/hosts, and looks like this:
mail.example.com
[webservers]
foo.example.com
bar.example.com
[dbservers]
one.example.com
two.example.com
three.example.com
The pattern ‘all’ or ‘*’ targets all systems in the inventory file.
It is possible to address specific hosts:
one.example.com one.example.com:two.example.com
The following patterns address one or more groups:
webservers webservers:dbservers
There is also a magic group ‘ungrouped’ which selects systems not in a group.
Specific hosts, wildcards, and groups can all be mixed in the same pattern
one*.com:dbservers
It is not possible to target a host not in the inventory file.