Browse Source

Don't assume role has default_route_networks/tags

This broken after new jinja release.

NOTE: This included nic config updates as well.
And changes for role.tags.

Co-Authored-By: Alex Schultz <aschultz@redhat.com>
Closes-Bug: #1928145
Change-Id: I9cbdcf289bae96f8ea7867e1cec365a9a07019ca
(cherry picked from commit 4af0c6ccac)
changes/57/791357/1
ramishra 1 month ago
parent
commit
9bbd4fe553
12 changed files with 32 additions and 28 deletions
  1. +1
    -1
      common/deploy-steps.j2
  2. +1
    -1
      deployment/octavia/octavia-deployment-config.j2.yaml
  3. +1
    -1
      environments/network-isolation-v6-all.j2.yaml
  4. +4
    -4
      network/config/2-linux-bonds-vlans/role.role.j2.yaml
  5. +3
    -3
      network/config/bond-with-vlans/role.role.j2.yaml
  6. +8
    -6
      network/config/multiple-nics-vlans/role.role.j2.yaml
  7. +7
    -5
      network/config/multiple-nics/role.role.j2.yaml
  8. +2
    -2
      network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml
  9. +2
    -2
      network/config/single-nic-vlans/role.role.j2.yaml
  10. +1
    -1
      overcloud-resource-registry-puppet.j2.yaml
  11. +1
    -1
      overcloud.j2.yaml
  12. +1
    -1
      puppet/role.role.j2.yaml

+ 1
- 1
common/deploy-steps.j2 View File

@ -7,7 +7,7 @@
{%- endif -%}
{%- set primary_role = [enabled_roles[0]] -%}
{%- for role in enabled_roles -%}
{%- if 'primary' in role.tags and 'controller' in role.tags -%}
{%- if role.tags is defined and 'primary' in role.tags and 'controller' in role.tags -%}
{%- set _ = primary_role.pop() -%}
{%- set _ = primary_role.append(role) -%}
{%- endif -%}


+ 1
- 1
deployment/octavia/octavia-deployment-config.j2.yaml View File

@ -1,6 +1,6 @@
heat_template_version: rocky
{%- set octavia_standalone=[] -%}
{%- for role in roles if 'standalone' in role.tags -%}
{%- for role in roles if role.tags is defined and 'standalone' in role.tags -%}
{% if octavia_standalone.append('1') %}{% endif %}
{%- endfor %}


+ 1
- 1
environments/network-isolation-v6-all.j2.yaml View File

@ -3,7 +3,7 @@
# or update.
{%- set primary_role = [roles[0]] -%}
{%- for role in roles -%}
{%- if 'primary' in role.tags and 'controller' in role.tags -%}
{%- if role.tags is defined and 'primary' in role.tags and 'controller' in role.tags -%}
{%- set _ = primary_role.pop() -%}
{%- set _ = primary_role.append(role) -%}
{%- endif -%}


+ 4
- 4
network/config/2-linux-bonds-vlans/role.role.j2.yaml View File

@ -59,7 +59,7 @@ parameters:
guaranteed to pass through the data path of the segments in the
{{network.name}} network.
type: number
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
{{network.name}}InterfaceDefaultRoute:
default: ''
description: default route for the {{network.name_lower}} network
@ -200,7 +200,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute
@ -241,7 +241,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute
@ -262,7 +262,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute


+ 3
- 3
network/config/bond-with-vlans/role.role.j2.yaml View File

@ -57,7 +57,7 @@ parameters:
guaranteed to pass through the data path of the segments in the
{{network.name}} network.
type: number
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
{{network.name}}InterfaceDefaultRoute:
default: ''
description: default route for the {{network.name_lower}} network
@ -184,7 +184,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute
@ -224,7 +224,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute


+ 8
- 6
network/config/multiple-nics-vlans/role.role.j2.yaml View File

@ -59,7 +59,7 @@ parameters:
guaranteed to pass through the data path of the segments in the
{{network.name}} network.
type: number
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
{{network.name}}InterfaceDefaultRoute:
default: ''
description: default route for the {{network.name_lower}} network
@ -74,14 +74,16 @@ parameters:
from the subnet host_routes attribute.
type: json
{%- endfor %}
{% for network in networks if network.name == "External" and 'external_bridge' in role.tags and not network.name in _role_networks %}
{% for network in networks if network.name == "External" %}
{% if role.tags is defined and 'external_bridge' in role.tags and not network.name in _role_networks %}
{{network.name}}Mtu:
default: {{network.mtu|default('1500')}}
description: The maximum transmission unit (MTU) size(in bytes) that is
guaranteed to pass through the data path of the segments in the
{{network.name}} network.
type: number
{% endfor %}
{%- endif %}
{%- endfor %}
DnsServers: # Override this via parameter_defaults
default: []
description: >
@ -155,14 +157,14 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute
{%- endif %}
{%- endif %}
{#- We need bridge also for ComputeDVR and Computes with OVN #}
{%- elif network.name in role.networks or 'external_bridge' in role.tags %}
{%- elif network.name in role.networks or (role.tags is defined and 'external_bridge' in role.tags) %}
- type: ovs_bridge
{%- if network.name == "External" %}
name: bridge_name
@ -193,7 +195,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute


+ 7
- 5
network/config/multiple-nics/role.role.j2.yaml View File

@ -59,7 +59,7 @@ parameters:
guaranteed to pass through the data path of the segments in the
{{network.name}} network.
type: number
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
{{network.name}}InterfaceDefaultRoute:
default: ''
description: default route for the {{network.name_lower}} network
@ -74,13 +74,15 @@ parameters:
from the subnet host_routes attribute.
type: json
{%- endfor %}
{% for network in networks if network.name == "External" and 'external_bridge' in role.tags and not network.name in _role_networks %}
{% for network in networks if network.name == "External" %}
{% if role.tags is defined and 'external_bridge' in role.tags and not network.name in _role_networks %}
{{network.name}}Mtu:
default: {{network.mtu|default('1500')}}
description: The maximum transmission unit (MTU) size(in bytes) that is
guaranteed to pass through the data path of the segments in the
{{network.name}} network.
type: number
{%- endif %}
{% endfor %}
DnsServers: # Override this via parameter_defaults
default: []
@ -149,14 +151,14 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute
{%- endif %}
{%- endif %}
{#- We need bridge also for ComputeDVR and Computes with OVN #}
{%- elif network.name in _role_networks or 'external_bridge' in role.tags %}
{%- elif network.name in role.networks or (role.tags is defined and 'external_bridge' in role.tags) %}
- type: ovs_bridge
{%- if network.name == "External" %}
name: bridge_name
@ -175,7 +177,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute


+ 2
- 2
network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml View File

@ -57,7 +57,7 @@ parameters:
guaranteed to pass through the data path of the segments in the
{{network.name}} network.
type: number
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
{{network.name}}InterfaceDefaultRoute:
default: ''
description: default route for the {{network.name_lower}} network
@ -165,7 +165,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute


+ 2
- 2
network/config/single-nic-vlans/role.role.j2.yaml View File

@ -57,7 +57,7 @@ parameters:
guaranteed to pass through the data path of the segments in the
{{network.name}} network.
type: number
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
{{network.name}}InterfaceDefaultRoute:
default: ''
description: default route for the {{network.name_lower}} network
@ -160,7 +160,7 @@ resources:
routes:
list_concat_unique:
- get_param: {{network.name}}InterfaceRoutes
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
- - default: true
next_hop:
get_param: {{network.name}}InterfaceDefaultRoute


+ 1
- 1
overcloud-resource-registry-puppet.j2.yaml View File

@ -18,7 +18,7 @@ resource_registry:
{%- for network in networks if network.enabled|default(true) and network.name in role.networks|default([]) %}
OS::TripleO::{{role.name}}::Ports::{{network.name}}Port: network/ports/noop.yaml
{%- endfor %}
{%- if 'external_bridge' in role.tags %}
{%- if role.tags is defined and 'external_bridge' in role.tags %}
# Create Neutron external bridge for floating IPs and/or SNAT
OS::TripleO::{{role.name}}::Net::SoftwareConfig: net-config-bridge.yaml
{%- else %}


+ 1
- 1
overcloud.j2.yaml View File

@ -1,6 +1,6 @@
{%- set primary_role = [roles[0]] -%}
{%- for role in roles -%}
{%- if 'primary' in role.tags and 'controller' in role.tags -%}
{%- if role.tags is defined and 'primary' in role.tags and 'controller' in role.tags -%}
{%- set _ = primary_role.pop() -%}
{%- set _ = primary_role.append(role) -%}
{%- endif -%}


+ 1
- 1
puppet/role.role.j2.yaml View File

@ -455,7 +455,7 @@ resources:
- {get_param: {{network.name}}InterfaceRoutes}
- {get_attr: [{{network.name}}Port, host_routes]}
{{network.name}}Mtu: {get_attr: [{{network.name}}Port, mtu]}
{%- if network.name in role.default_route_networks %}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
{{network.name}}InterfaceDefaultRoute: {get_attr: [{{network.name}}Port, gateway_ip]}
{%- endif %}
{%- if role.networks is mapping %}


Loading…
Cancel
Save