From 4237287731bf733317ae8a75276cc5beeaa639e4 Mon Sep 17 00:00:00 2001 From: "neith (Jean-Alexis Lauricella)" Date: Fri, 2 Jun 2017 16:05:30 +0200 Subject: [PATCH] Avoid retrieving IP from a bridge without IP In some cases, bridges are defined without static IP address. This patch checks if the bridge has an IP, otherwise skip to the next method to determine node IP. Change-Id: I2c79f7dde5b820ae02a6ed09dbb59e690055f5f8 Closes-Bug: #1695274 --- playbooks/common-tasks/dynamic-address-fact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/common-tasks/dynamic-address-fact.yml b/playbooks/common-tasks/dynamic-address-fact.yml index 33007fc87e..ea72853c6f 100644 --- a/playbooks/common-tasks/dynamic-address-fact.yml +++ b/playbooks/common-tasks/dynamic-address-fact.yml @@ -29,7 +29,7 @@ {%- else -%} {%- set _bridge = 'no_bridge_defined' -%} {%- endif -%} - {%- if _bridge != 'no_bridge_defined' -%} + {%- if _bridge != 'no_bridge_defined' and hostvars[inventory_hostname]['ansible_' + _bridge]['ipv4'] is defined-%} {{ hostvars[inventory_hostname]['ansible_' + _bridge]['ipv4']['address'] }} {%- elif _network_data['address'] is defined -%} {{ _network_data['address'] }}