mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #14949 from mscherer/fix_faq_syntax
Fix the lexer used, jinja2 is not valid, jinja is
This commit is contained in:
commit
9be6974d37
1 changed files with 1 additions and 1 deletions
|
@ -177,7 +177,7 @@ How do I loop over a list of hosts in a group, inside of a template?
|
||||||
A pretty common pattern is to iterate over a list of hosts inside of a host group, perhaps to populate a template configuration
|
A pretty common pattern is to iterate over a list of hosts inside of a host group, perhaps to populate a template configuration
|
||||||
file with a list of servers. To do this, you can just access the "$groups" dictionary in your template, like this:
|
file with a list of servers. To do this, you can just access the "$groups" dictionary in your template, like this:
|
||||||
|
|
||||||
.. code-block:: jinja2
|
.. code-block:: jinja
|
||||||
|
|
||||||
{% for host in groups['db_servers'] %}
|
{% for host in groups['db_servers'] %}
|
||||||
{{ host }}
|
{{ host }}
|
||||||
|
|
Loading…
Reference in a new issue