tripleo-common/roles/tripleo-hieradata/templates/fqdn.j2
Alex Schultz 81738cda4d Skip processing network info if not defined
If role_networks or network_cidrs is not defined, the jinja parsing
fails because NoneType is not iterable when doing a
'if value in none_type_var'

Change-Id: I477f0b840b2a0d2646ba947a88f5264d330ea4eb
Closes-Bug: #1837644
2019-07-23 11:15:49 -06:00

14 lines
587 B
Django/Jinja

{
"fqdn_ctlplane": "{{ inventory_hostname ~ '.ctlplane.' ~ cloud_domain }}",
"fqdn_canonical": "{{ inventory_hostname ~ '.' ~ cloud_domain }}"{% if enabled_networks | length > 0 and role_networks and role_networks | length > 0 %},{% endif %}
{% if role_networks %}
{% for network in enabled_networks %}
{% if network in role_networks %}
"fqdn_{{ networks[network]['name_lower'] }}": "{{ inventory_hostname ~ '.' ~ network | lower ~ '.' ~ cloud_domain }}"
{%- endif %}{% if not loop.last and loop.nextitem | default("") in role_networks %},
{% endif %}
{%- endfor %}
{% endif %}
}