Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Don't assume every role has default_route_networks
Browse files Browse the repository at this point in the history
This broken after new jinja release.

NOTE: This included nic config updates as well.

Co-Authored-By: Alex Schultz <[email protected]>
Closes-Bug: #1928145
Change-Id: I9cbdcf289bae96f8ea7867e1cec365a9a07019ca
(cherry picked from commit 4af0c6c)
  • Loading branch information
rabi authored and mwhahaha committed May 12, 2021
1 parent 59d1947 commit 1311f8a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion network/config/2-linux-bonds-vlans/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion network/config/bond-with-vlans/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion network/config/multiple-nics-vlans/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion network/config/multiple-nics/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion network/config/single-nic-vlans/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions overcloud.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ resources:
{{network.name_lower}}_host_routes:
list_concat_unique:
- {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{_role_net_subnet}}, host_routes]}
{%- 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_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{_role_net_subnet}}, gateway_ip]}
{%- endif %}
Expand Down Expand Up @@ -1075,7 +1075,7 @@ resources:
service_metadata_settings: {get_attr: [{{role.name}}ServiceChainRoleData, value, service_metadata_settings]}
tripleo_network_config_template: {get_param: {{role.name}}NetworkConfigTemplate}
tripleo_network_config_with_ansible: {get_param: NetworkConfigWithAnsible}
default_route_networks: {{role.default_route_networks}}
default_route_networks: {{role.default_route_networks|default(['ControlPlane'])}}
networks_skip_config: {{ role.networks_skip_config|default([]) }}
role_tags: {{role.tags}}

Expand Down Expand Up @@ -1108,7 +1108,7 @@ resources:
{{network.name}}InterfaceRoutes:
list_concat_unique:
- {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{_role_net_subnet}}, host_routes]}
{%- 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_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{_role_net_subnet}}, gateway_ip]}
{%- endif %}
Expand All @@ -1120,7 +1120,7 @@ resources:
not $.data.where($.startsWith('tripleo_vlan_id')).len() => 1,
true => int($.data.where($.startsWith('tripleo_vlan_id')).first().split('=').last()))
data: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{_role_net_subnet}}, tags]}
{%- 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: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{_role_net_subnet}}, gateway_ip]}
{%- endif %}
{%- endfor %}
Expand Down

0 comments on commit 1311f8a

Please sign in to comment.