mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Update example syntax in playbooks_loops.rst. (#35679)
This commit is contained in:
parent
aeb749e116
commit
060890f3b2
1 changed files with 6 additions and 2 deletions
|
@ -48,10 +48,14 @@ Some plugins like, the yum and apt modules can take lists directly to their opti
|
||||||
See each action's documentation for details, for now here is an example::
|
See each action's documentation for details, for now here is an example::
|
||||||
|
|
||||||
- name: optimal yum
|
- name: optimal yum
|
||||||
yum: name={{list_of_packages}} state=present
|
yum:
|
||||||
|
name: "{{list_of_packages}}"
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: non optimal yum, not only slower but might cause issues with interdependencies
|
- name: non optimal yum, not only slower but might cause issues with interdependencies
|
||||||
yum: name={{item}} state=present
|
yum:
|
||||||
|
name: "{{item}}"
|
||||||
|
state: present
|
||||||
loop: "{{list_of_packages}}"
|
loop: "{{list_of_packages}}"
|
||||||
|
|
||||||
Note that the types of items you iterate over do not have to be simple lists of strings.
|
Note that the types of items you iterate over do not have to be simple lists of strings.
|
||||||
|
|
Loading…
Reference in a new issue