environments/net-multiple-nics.yaml - ansible template Fails with 'NoneType' is not iterable

Bug #1904808 reported by Harald Jensås
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Harald Jensås

Bug Description

2020-11-19 01:52:27.697740 | fa163e2c-ca03-4fe4-5856-000000000acf | FATAL | Render network_config from template | compute-0 | error={"changed": false, "msg": "AnsibleError: Unexpected templating type error occurred on (---
network_config:
- type: interface
  name: nic1
  mtu: {{ ctlplane_mtu }}
  dns_servers: {{ ctlplane_dns_nameservers }}
  domain: {{ dns_search_domains }}
  routes: {{ ctlplane_host_routes }}
  use_dhcp: false
  addresses:
  - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
{% set nics_used = [1] %}
{% for network in role_networks and network not in networks_skip_config|default([]) %}
{% if network not in [\"External\", \"Tenant\"] %}
- type: interface
  name: nic{{ loop.index +1 }}
  mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
  use_dhcp: false
  addresses:
  - ip_netmask:
      {{ lookup('vars', role_networks_lower[network] ~ '_ip') }}/{{ lookup('vars', role_networks_lower[network] ~ '_cidr') }}
  routes: {{ lookup('vars', role_networks_lower[network] ~ '_host_routes') }}
{% elif network == 'Tenant' %}
- type: ovs_bridge
  name: {{ 'br-' ~ role_networks_lower[network] }}
  name: {{ neutron_physical_bridge_name }}
  mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
  dns_servers: {{ ctlplane_dns_nameservers }}
  use_dhcp: false
  addresses:
  - ip_netmask:
      {{ lookup('vars', role_networks_lower[network] ~ '_ip') }}/{{ lookup('vars', role_networks_lower[network] ~ '_cidr') }}
  routes: {{ lookup('vars', role_networks_lower[network] ~ '_host_routes') }}
  members:
  - type: interface
    name: nic{{loop.index + 1}}
    mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
    use_dhcp: false
    primary: true
{% endif %}
{% set _ = nics_used.append(loop.index) %}
{% endfor %}
- type: ovs_bridge
  name: {{ neutron_physical_bridge_name }}
  mtu: {{ lookup('vars', role_networks_lower['External'] ~ '_mtu') }}
  dns_servers: {{ ctlplane_dns_nameservers }}
  use_dhcp: false
  members:
  - type: interface
    name: nic{{nics_used[-1] + 1}}
    mtu: {{ lookup('vars', role_networks_lower['External'] ~ '_mtu') }}
    primary: true
): argument of type 'NoneType' is not iterable"}

in the inventory:
 networks_skip_config: null

In the code:
  {% for network in role_networks and network not in networks_skip_config|default([]) %}

networks_skip_config is defined as 'null', and thus does not default to [].

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.opendev.org/763296

Changed in tripleo:
assignee: nobody → Harald Jensås (harald-jensas)
status: Triaged → In Progress
Changed in tripleo:
milestone: wallaby-1 → wallaby-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 13.1.0

This issue was fixed in the openstack/tripleo-heat-templates 13.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 14.0.0

This issue was fixed in the openstack/tripleo-heat-templates 14.0.0 release.

Changed in tripleo:
milestone: wallaby-2 → wallaby-3
Changed in tripleo:
milestone: wallaby-3 → wallaby-rc1
Changed in tripleo:
milestone: wallaby-rc1 → xena-1
Changed in tripleo:
milestone: xena-1 → xena-2
Changed in tripleo:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.