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
This commit is contained in:
parent
1986b06d8f
commit
4237287731
@ -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'] }}
|
||||
|
Loading…
Reference in New Issue
Block a user