June 2020
Intermediate to advanced
410 pages
9h 52m
English
We have already established that you will often want to run either an ad hoc command or a playbook against only a subsection of your inventory. So far, we have been quite precise in doing that, but let's now expand upon this by looking at how Ansible can work with patterns to figure out which hosts a command (or playbook) should be run against.
As a starting point, let's consider again an inventory that we defined earlier in this chapter for the purposes of exploring host groups and child groups. For your convenience, the inventory contents are provided again here:
loadbalancer.example.com[frontends]frt01.example.comfrt02.example.com[apps]app01.example.comapp02.example.com[databases]dbms01.example.com ...