-
Bug
-
Resolution: Done
-
Major
-
RH294 - RHEL9.0-en-1-20221012
-
None
-
4
-
en-US (English)
URL:
Reporter RHNID:
Section: -
Language: en-US (English)||||||||
Workaround:
Description: In ch04s02 GE "Writing Loops and Conditional Tasks", the example of how to write a loop in step 3.2 uses ansible.builtin.dnf to operate on a list of packages.
While this technically works, it's also terribly inefficient since it essentially runs the ansible.builtin.dnf module once for each package. This is slower than simply providing a list of package names to the module's name parameter. It's also true that if two of those packages depend upon each other, the task will fail because the dependencies will not be met.
We used to have an admonition box somewhere telling folks about the negative performance implications of using ansible.builtin.dnf with a loop, but I'm not seeing it offhand.
We should change this activity so that it does something that is actually a recommended practice as opposed to what it does now, which is not a recommended practice.