mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Support «hosts: groupname[1:]» notation (~= 'the rest of the group')
This commit is contained in:
@@ -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 '~'::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user