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

Commit

Permalink
Add neutron port tag hint for default_route_network
Browse files Browse the repository at this point in the history
Adds a tag tripleo_default_route=$BOOL to neutron ports
created by heat indicating if the ports interface is
used for the default route.

The value is controlled by the 'default_route_networks'
in roles data.

With network-data-v2 the same tag will be used to
set up ansible vars appropriately. Having the heat driven
process add the tag can be useful for upgrade/migration
automation.

Related: blueprint network-data-v2-ports
Change-Id: I20d48b3a29193dbcb70ec5cb13daf153bb0aeff2
  • Loading branch information
hjensas committed Mar 30, 2021
1 parent b40d5d7 commit cea78ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions network/ports/port.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ parameters:
default: delete
constraints:
- allowed_values: [delete, retain]
DefaultRoute:
description: >
Whether this interface is used for the default route
type: boolean
default: false

conditions:
network_is_ctlplane:
Expand Down Expand Up @@ -98,6 +103,10 @@ resources:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}
- str_replace:
template: tripleo_default_route=$BOOL
params:
$BOOL: {get_param: DefaultRoute}

outputs:
ip_address:
Expand Down
5 changes: 5 additions & 0 deletions network/ports/port_from_pool.j2
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ parameters:
{%- endif %}
description: Cidr for the {{network.name_lower}} network.
type: string
DefaultRoute: # Here for compatibility
description: >
Whether this interface is used for the default route
type: boolean
default: false

outputs:
ip_address:
Expand Down
3 changes: 3 additions & 0 deletions puppet/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ resources:
{%- endif %}
- {get_param: {{role.name}}IPs}
NodeIndex: {get_param: NodeIndex}
{%- if role.default_route_networks is defined and network.name in role.default_route_networks %}
DefaultRoute: true
{%- endif %}
{%- endif %}
{%- endfor %}

Expand Down

0 comments on commit cea78ad

Please sign in to comment.