mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Merge pull request #12436 from amenonsen/ranges
Support «hosts: foo[1:]» and add tests for split/apply_subscript
This commit is contained in:
commit
37f2cbc429
3 changed files with 41 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