mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 21:30:22 -07:00
Support «hosts: groupname[1:]» notation (~= 'the rest of the group')
This commit is contained in:
parent
21142f5723
commit
2fcdb37e7b
3 changed files with 13 additions and 5 deletions
|
@ -79,8 +79,9 @@ You can refer to hosts within the group by adding a subscript to the group name:
|
|||
|
||||
webservers[0] # == cobweb
|
||||
webservers[-1] # == weber
|
||||
webservers[0:1] # == webservers[0]:webservers[1]
|
||||
# == cobweb:webbing
|
||||
webservers[0:1] # == webservers[0],webservers[1]
|
||||
# == cobweb,webbing
|
||||
webservers[1:] # == webbing,weber
|
||||
|
||||
Most people don't specify patterns as regular expressions, but you can. Just start the pattern with a '~'::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue