mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Describe the groupname[x]/[x:y] syntax in more detail
This commit is contained in:
parent
846f0b0510
commit
d9086ab46b
1 changed files with 11 additions and 5 deletions
|
@ -68,13 +68,19 @@ It's also ok to mix wildcard patterns and groups at the same time::
|
||||||
|
|
||||||
one*.com:dbservers
|
one*.com:dbservers
|
||||||
|
|
||||||
As an advanced usage, you can also select the numbered server in a group::
|
You can select a host or subset of hosts from a group by their position. For example, given the following group::
|
||||||
|
|
||||||
webservers[0]
|
|
||||||
|
|
||||||
Or a range of servers in a group::
|
[webservers]
|
||||||
|
cobweb
|
||||||
|
webbing
|
||||||
|
weber
|
||||||
|
|
||||||
webservers[0:25]
|
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
|
||||||
|
|
||||||
Most people don't specify patterns as regular expressions, but you can. Just start the pattern with a '~'::
|
Most people don't specify patterns as regular expressions, but you can. Just start the pattern with a '~'::
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue