March 2019
Intermediate to advanced
412 pages
9h 49m
English
The first thing that most plays define (after a name, of course) is a host pattern for the play. This is the pattern used to select hosts out of the inventory object to run the tasks on. Generally, this is straightforward; a host pattern contains one or more blocks indicating a host, group, wildcard pattern, or regex to use for the selection. Blocks are separated by a colon, wildcards are just an asterisk, and regex patterns start with a tilde:
hostname:groupname:*.example:~(web|db)\.example\.com
Advanced usage can include group index selection or even ranges within a group:
webservers[0]:webservers[2:4]
Each block is treated as an inclusion block; that is, all the hosts found in the first pattern are ...
Read now
Unlock full access