ansible-collections / ansible-consul

:satellite: Ansible role for Hashicorp Consul clusters

Home Page:https://galaxy.ansible.com/ansible-community/consul/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The loop variable 'item' is already in use

rgarrigue opened this issue · comments

commented

Hi there

I've been seing those warning for ages. It's a bit annoying, worsening the output's readability

included: /opt/monitoring/roles/brianshumate.consul/tasks/nix.yml for i-06ec16f566d000ebc
[WARNING]: 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.
[WARNING]: 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.
[WARNING]: 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.
[WARNING]: 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.
[WARNING]: 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.

Do you mind fixing them ? Should just be replacing item by my_item and add a loop_control.loop_var: my_item

Best regards,

commented

Please do! We are open to pull-requests. Discuss in this issue what causes this.

Indeed, this should be a pretty easy fix. See #483.