Miscellaneous fixes in user_guide/intro_inventory.rst docs (#72202)
* Fixing missing hosts entry under the group dict. * Added missing 'vars:' key * Reordering arguments for consistency with the format displayed by "ansible-playbook --help" * Fixing contradictory text
This commit is contained in:
parent
02658d7bf8
commit
afba5c2852
1 changed files with 11 additions and 8 deletions
|
@ -220,6 +220,7 @@ In YAML:
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
atlanta:
|
atlanta:
|
||||||
|
hosts:
|
||||||
host1:
|
host1:
|
||||||
http_port: 80
|
http_port: 80
|
||||||
maxRequestsPerChild: 808
|
maxRequestsPerChild: 808
|
||||||
|
@ -446,9 +447,11 @@ You can change this behavior by setting the group variable ``ansible_group_prior
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
a_group:
|
a_group:
|
||||||
|
vars:
|
||||||
testvar: a
|
testvar: a
|
||||||
ansible_group_priority: 10
|
ansible_group_priority: 10
|
||||||
b_group:
|
b_group:
|
||||||
|
vars:
|
||||||
testvar: b
|
testvar: b
|
||||||
|
|
||||||
In this example, if both groups have the same priority, the result would normally have been ``testvar == b``, but since we are giving the ``a_group`` a higher priority the result will be ``testvar == a``.
|
In this example, if both groups have the same priority, the result would normally have been ``testvar == b``, but since we are giving the ``a_group`` a higher priority the result will be ``testvar == a``.
|
||||||
|
@ -727,7 +730,7 @@ To apply a playbook called :file:`site.yml`
|
||||||
to all the app servers in the test environment, use the
|
to all the app servers in the test environment, use the
|
||||||
following command::
|
following command::
|
||||||
|
|
||||||
ansible-playbook -i inventory_test site.yml -l appservers
|
ansible-playbook -i inventory_test -l appservers site.yml
|
||||||
|
|
||||||
.. _inventory_setup-per_function:
|
.. _inventory_setup-per_function:
|
||||||
|
|
||||||
|
@ -737,7 +740,7 @@ Example: Group by function
|
||||||
In the previous section you already saw an example for using groups in
|
In the previous section you already saw an example for using groups in
|
||||||
order to cluster hosts that have the same function. This allows you,
|
order to cluster hosts that have the same function. This allows you,
|
||||||
for instance, to define firewall rules inside a playbook or role
|
for instance, to define firewall rules inside a playbook or role
|
||||||
without affecting database servers:
|
affecting only database servers:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue