Handle blank public_ipv4

Some clouds such as limestone have no public_ipv4; handle this in the
firewall setup

Change-Id: Id4a8032a6a14a040d62d1c70bf5e6e789fd8ff55
This commit is contained in:
Ian Wienand 2018-03-27 19:53:51 +11:00 committed by Jens Harbott
parent ad683253ed
commit 3230139d65

View File

@ -3,8 +3,12 @@
ipv4_addresses: >
{% set hosts = [] -%}
{% for host, vars in hostvars.items() -%}
{% set _ = hosts.append(vars['nodepool']['private_ipv4']) -%}
{% set _ = hosts.append(vars['nodepool']['public_ipv4']) -%}
{% if vars['nodepool']['private_ipv4'] -%}
{% set _ = hosts.append(vars['nodepool']['private_ipv4']) -%}
{% endif -%}
{% if vars['nodepool']['public_ipv4'] -%}
{% set _ = hosts.append(vars['nodepool']['public_ipv4']) -%}
{% endif -%}
{% endfor -%}
{{- hosts | sort | unique -}}
ipv6_addresses: >