mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
FAQ: fix a typo, add link to 'vars' lookup (#42412)
* FAQ: add link to vars plugin doc * Typo (s/Techinically/Technically/)
This commit is contained in:
parent
ab2e6fded1
commit
95649dc793
1 changed files with 2 additions and 2 deletions
|
@ -344,7 +344,7 @@ Also see dynamic_variables_.
|
||||||
How do I access a group variable?
|
How do I access a group variable?
|
||||||
+++++++++++++++++++++++++++++++++
|
+++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
Techinically, you don't, Ansible does not really use groups directly. Groups are label for host selection and a way to bulk assign variables, they are not a first class entity, Ansible only cares about Hosts and Tasks.
|
Technically, you don't, Ansible does not really use groups directly. Groups are label for host selection and a way to bulk assign variables, they are not a first class entity, Ansible only cares about Hosts and Tasks.
|
||||||
|
|
||||||
That said, you could just access the variable by selecting a host that is part of that group, see first_host_in_a_group_ below for an example.
|
That said, you could just access the variable by selecting a host that is part of that group, see first_host_in_a_group_ below for an example.
|
||||||
|
|
||||||
|
@ -580,7 +580,7 @@ The above DOES NOT WORK as you expect, if you need to use a dynamic variable use
|
||||||
|
|
||||||
{{ hostvars[inventory_hostname]['somevar_' + other_var] }}
|
{{ hostvars[inventory_hostname]['somevar_' + other_var] }}
|
||||||
|
|
||||||
For 'non host vars' you can use the vars lookup plugin:
|
For 'non host vars' you can use the :ref:`vars lookup<vars_lookup>` plugin:
|
||||||
|
|
||||||
.. code-block:: jinja
|
.. code-block:: jinja
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue