Update intro_inventory.rst to show YAML ranges (#49265)
Adds a YAML example inventory listing a range of hosts to complement existing INI example.
This commit is contained in:
parent
4096d74245
commit
5c525f9466
1 changed files with 11 additions and 0 deletions
|
@ -104,11 +104,22 @@ Generally speaking, this is not the best way to define variables that describe y
|
||||||
|
|
||||||
If you are adding a lot of hosts following similar patterns, you can do this rather than listing each hostname:
|
If you are adding a lot of hosts following similar patterns, you can do this rather than listing each hostname:
|
||||||
|
|
||||||
|
In INI:
|
||||||
|
|
||||||
.. code-block:: guess
|
.. code-block:: guess
|
||||||
|
|
||||||
[webservers]
|
[webservers]
|
||||||
www[01:50].example.com
|
www[01:50].example.com
|
||||||
|
|
||||||
|
In YAML:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
...
|
||||||
|
webservers:
|
||||||
|
hosts:
|
||||||
|
www[01:50].example.com:
|
||||||
|
|
||||||
For numeric patterns, leading zeros can be included or removed, as desired. Ranges are inclusive. You can also define alphabetic ranges:
|
For numeric patterns, leading zeros can be included or removed, as desired. Ranges are inclusive. You can also define alphabetic ranges:
|
||||||
|
|
||||||
.. code-block:: guess
|
.. code-block:: guess
|
||||||
|
|
Loading…
Add table
Reference in a new issue