rgwloadbalancer undefined index variable

The vrrp_instances variable is using a loop with index but the index_var
wasn't defined.
As a result, the fact task was failing on this undefined index variable.

The task includes an option with an undefined variable. The error was:
'index' is undefined

Closes: #5395

Signed-off-by: Florian Faltermeier <florian.faltermeier@uibk.ac.at>
(cherry picked from commit 3f906e0c26)
pull/5409/head
Ansible Deployment User 2020-05-26 13:18:03 +02:00 committed by Dimitri Savineau
parent c67b3d3530
commit 85df54a698
1 changed files with 3 additions and 1 deletions

View File

@ -19,8 +19,10 @@
- name: set_fact vip to vrrp_instance
set_fact:
vrrp_instances: "{{ vrrp_instances | default([]) | union([{ 'name': 'VI_' + index|string , 'vip': item }]) }}"
vrrp_instances: "{{ vrrp_instances | default([]) | union([{ 'name': 'VI_' + index|string , 'vip': item }]) }}"
loop: "{{ virtual_ips | flatten(levels=1) }}"
loop_control:
index_var: index
- name: "generate keepalived: configuration file: keepalived.conf"
template: