Avoid potential loop_var shadowing (#11162)

With CentOS, kubespray currently produces the following warning:

[WARNING]: TASK: bootstrap-os : Enable Oracle Linux repo: The loop variable
'item' is already in use. You should set the `loop_var` value in the
`loop_control` option for the task to something else to avoid variable
collisions and unexpected behavior.

This could bites us in nasty ways, so fix it.
pull/11177/head
Max Gautier 2024-05-13 10:14:30 +00:00 committed by GitHub
parent 41036e3b53
commit d870a3ee4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -24,10 +24,12 @@
- vars/ - vars/
skip: True skip: True
- name: Include tasks - name: Include tasks
include_tasks: "{{ item }}" include_tasks: "{{ included_tasks_file }}"
with_first_found: with_first_found:
- <<: *search - <<: *search
paths: [] paths: []
loop_control:
loop_var: included_tasks_file
- name: Create remote_tmp for it is used by another module - name: Create remote_tmp for it is used by another module