Browse Source

Fix floating IP logic in destroy

There's a logic bug in the destroy action: ip_flag is assuming string
context when it should be assuming list context.  This causes ip_flag to
never get set to true and therefore floating IP's never get destroyed.
This can lead to floating IP exhaustion, particularly in environments
with a low number of allocatable floating IP's.

This patch corrects the problem by fixing the logic to check for a list
length of zero rather than an empty string.

Change-Id: I0205ac406e604365560360fc2953a5e90e1c9be3
Depends-On: Ifa9eeb9d761d9801cab580445e6c43c8cf1dfdaa
Mark T. Voelker 1 year ago
parent
commit
36900e12cd
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      workloads/ansible/shade/k8s/roles/provision/tasks/destroy.yml

+ 1
- 1
workloads/ansible/shade/k8s/roles/provision/tasks/destroy.yml View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 - name: Setup release floating IP flag
4 4
   set_fact:
5
-    ip_flag: "{{ app_env.app_setting.ips[inventory_hostname] == '' }}"
5
+    ip_flag: "{{ app_env.app_setting.ips[inventory_hostname]|length == 0 }}"
6 6
 
7 7
 - name: Destroy the OpenStack VM
8 8
   os_server:

Loading…
Cancel
Save