mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Added a host expansion feature to ansible's inventory parsing
This commit is contained in:
parent
2d1c297fb8
commit
e3b2521f01
7 changed files with 87 additions and 16 deletions
|
@ -140,7 +140,19 @@ Connection type to use\&. Possible options are
|
|||
.RE
|
||||
.SH "INVENTORY"
|
||||
.sp
|
||||
Ansible stores the hosts it can potentially operate on in an inventory file\&. The syntax is one host per line\&. Groups headers are allowed and are included on their own line, enclosed in square brackets\&.
|
||||
Ansible stores the hosts it can potentially operate on in an inventory
|
||||
file\&. The syntax is one host per line\&. Optionally, ansible can use a
|
||||
line of the form base[beg:end]tail to define a set of hosts, where
|
||||
[beg:end] defines a numerical range. If 'beg' is left out, it
|
||||
defaults to 0\&. An example: mail[1:6].example.com, where 'head'
|
||||
is 'mail', 'beg' is 1, 'end' is 6, and 'tail' is '.example.com'\&. In
|
||||
addition, 'beg' can be a a string padded with zero(s) to the left. If so
|
||||
provided, it acts as a formatting hint during hostname expansion. The usage
|
||||
must be confirmed by having an 'end' that has the same length as 'beg',
|
||||
else an exception is raised. An example: mail[001:003].example.com is to be
|
||||
expanded to mail001.example.com, mail002.example.com, and
|
||||
mail003.example.com\&. Groups headers are allowed and are included on their
|
||||
own line, enclosed in square brackets\&.
|
||||
.SH "FILES"
|
||||
.sp
|
||||
/etc/ansible/hosts \(em Default inventory file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue