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
pull/71530/head
Jaime Hablutzel 4 years ago committed by GitHub
parent 02658d7bf8
commit afba5c2852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -220,12 +220,13 @@ In YAML:
.. code-block:: yaml .. code-block:: yaml
atlanta: atlanta:
host1: hosts:
http_port: 80 host1:
maxRequestsPerChild: 808 http_port: 80
host2: maxRequestsPerChild: 808
http_port: 303 host2:
maxRequestsPerChild: 909 http_port: 303
maxRequestsPerChild: 909
Unique values like non-standard SSH ports work well as host variables. You can add them to your Ansible inventory by adding the port number after the hostname with a colon: Unique values like non-standard SSH ports work well as host variables. You can add them to your Ansible inventory by adding the port number after the hostname with a colon:
@ -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…
Cancel
Save