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

Commit

Permalink
Set tags on all OS::Neutron::Port resources
Browse files Browse the repository at this point in the history
Set up tag hints on all OS::Neutron::Port resources.
The network-data-v2 work uses tags on neutron resources
to find existing resources so that we update instead
of create. Also for generating environment files info
in the neutron tag field is utilized.

Partial-Implements: blueprint network-data-v2-ports
Change-Id: I3d43ae22cc45e5528ecfb1a6b2cb8602faa162a0
  • Loading branch information
hjensas committed Apr 12, 2021
1 parent e48eef9 commit 73684d0
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 11 deletions.
8 changes: 8 additions & 0 deletions deployed-server/ctlplane-port.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
heat_template_version: wallaby

parameters:
RootStackName:
description: The name of the stack/plan.
type: string
network:
type: string
default: ctlplane
Expand Down Expand Up @@ -33,6 +36,11 @@ resources:
- - {get_param: name}
- port
replacement_policy: AUTO
tags:
- str_replace:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}

outputs:
fixed_ips:
Expand Down
3 changes: 3 additions & 0 deletions deployed-server/deployed-neutron-port.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ parameters:
DeployedServerPortMap:
default: {}
type: json
IsVirtualIP: # Here for compatibility
default: false
type: boolean


outputs:
Expand Down
8 changes: 8 additions & 0 deletions deployed-server/deployed-server.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
heat_template_version: wallaby
parameters:
RootStackName:
description: The name of the stack/plan.
type: string
image:
type: string
default: unused
Expand Down Expand Up @@ -76,6 +79,11 @@ resources:
- - {get_param: name}
- ctlplane
replacement_policy: AUTO
tags:
- str_replace:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}

outputs:
OS::stack_id:
Expand Down
16 changes: 15 additions & 1 deletion network/ports/ctlplane_vip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description: >
The IP address will be chosen automatically if FixedIPs is empty.
parameters:
RootStackName:
description: The name of the stack/plan.
type: string
ServiceName: # Here for compatibility with from_service.yaml
description: Name of the service to lookup
default: ''
Expand Down Expand Up @@ -45,6 +48,9 @@ parameters:
[{'ip_address':'1.2.3.4'}]
default: []
type: json
IsVirtualIP: # Here for compatibility
type: boolean
default: false

conditions:
fixed_ip_not_set:
Expand All @@ -67,7 +73,15 @@ resources:
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: FixedIPs
replacement_policy: AUTO

tags:
- str_replace:
template: tripleo_vip_net=$NET_NAME
params:
$NET_NAME: {get_param: ControlPlaneNetwork}
- str_replace:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}
outputs:
ip_address:
description: Virtual IP network IP
Expand Down
3 changes: 3 additions & 0 deletions network/ports/deployed_port.j2
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ parameters:
A map of deployed port data
default: {}
type: json
IsVirtualIP: # Here for compatibility
type: boolean
default: false

resources:

Expand Down
2 changes: 1 addition & 1 deletion network/ports/deployed_vip_port.j2
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ parameters:
NodeIndex: # Here for compatibility with from_pool.yaml
default: 0
type: number
VipPort: # Here for compatibility
IsVirtualIP: # Here for compatibility
type: boolean
default: false
VipPortMap:
Expand Down
3 changes: 3 additions & 0 deletions network/ports/from_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ parameters:
[{'ip_address':'1.2.3.4'}]
default: []
type: json
IsVirtualIP: # Here for compatibility
type: boolean
default: false
ServiceVips:
default: {}
type: json
Expand Down
3 changes: 3 additions & 0 deletions network/ports/from_service_v6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ parameters:
[{'ip_address':'1.2.3.4'}]
default: []
type: json
IsVirtualIP: # Here for compatibility
type: boolean
default: false
ServiceVips:
default: {}
type: json
Expand Down
3 changes: 3 additions & 0 deletions network/ports/noop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ parameters:
default: 0
description: Index of the IP to get from Pool
type: number
IsVirtualIP: # Here for compatibility
type: boolean
default: false

outputs:
ip_address:
Expand Down
16 changes: 16 additions & 0 deletions network/ports/ovn_mac_addr_port.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ description: >
Port without IP address, used to allocate MAC addresses for OVN chassis.
parameters:
RootStackName:
description: The name of the stack/plan.
type: string
PortName:
description: Name of the port
default: ''
Expand All @@ -29,6 +32,19 @@ resources:
name: {get_param: PortName}
network: {get_param: OVNMacAddressNetworkName}
fixed_ips: []
tags:
- str_replace:
template: tripleo_ovn_mac_port_name=$PORT_NAME
params:
$PORT_NAME: {get_param: PortName}
- str_replace:
template: tripleo_ovn_mac_net=$NET_NAME
params:
$NET_NAME: {get_param: OVNMacAddressNetworkName}
- str_replace:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}

outputs:
mac_address:
Expand Down
29 changes: 21 additions & 8 deletions network/ports/port.j2
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ parameters:
Whether this interface is used for the default route
type: boolean
default: false
IsVirtualIP:
type: boolean
default: false

conditions:
network_is_ctlplane:
Expand Down Expand Up @@ -99,14 +102,24 @@ resources:
- get_param: FixedIPs
replacement_policy: AUTO
tags:
- str_replace:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}
- str_replace:
template: tripleo_default_route=$BOOL
params:
$BOOL: {get_param: DefaultRoute}
if:
- {get_param: IsVirtualIP}
- - str_replace:
template: tripleo_vip_net=$NET_NAME
params:
$NET_NAME: {get_param: {{network.name}}NetName}
- str_replace:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}
- - str_replace:
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
3 changes: 3 additions & 0 deletions network/ports/port_from_pool.j2
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ parameters:
Whether this interface is used for the default route
type: boolean
default: false
IsVirtualIP: # Here for compatibility
default: false
type: boolean

outputs:
ip_address:
Expand Down
15 changes: 15 additions & 0 deletions network/ports/vip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description: >
The IP address will be chosen automatically if FixedIPs is empty.
parameters:
RootStackName:
description: The name of the stack/plan.
type: string
ServiceName: # Here for compatibility with from_service.yaml
description: Name of the service to lookup
default: ''
Expand Down Expand Up @@ -53,6 +56,9 @@ parameters:
default: delete
constraints:
- allowed_values: [delete, retain]
IsVirtualIP: # Here for compatibility
type: boolean
default: false

conditions:
network_is_ctlplane:
Expand Down Expand Up @@ -83,6 +89,15 @@ resources:
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: FixedIPs
replacement_policy: AUTO
tags:
- str_replace:
template: tripleo_service_vip=$SERVICE_NAME
params:
$SERVICE_NAME: {get_param: ServiceName}
- str_replace:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}

outputs:
ip_address:
Expand Down
16 changes: 15 additions & 1 deletion network/ports/vip_v6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description: >
The IP address will be chosen automatically if FixedIPs is empty.
parameters:
RootStackName:
description: The name of the stack/plan.
type: string
ServiceName: # Here for compatibility with from_service.yaml
description: Name of the service to lookup
default: ''
Expand Down Expand Up @@ -45,6 +48,9 @@ parameters:
[{'ip_address':'1.2.3.4'}]
default: []
type: json
IsVirtualIP: # Here for compatibility
type: boolean
default: false

conditions:
network_is_ctlplane:
Expand Down Expand Up @@ -74,7 +80,15 @@ resources:
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: FixedIPs
replacement_policy: AUTO

tags:
- str_replace:
template: tripleo_service_vip=$SERVICE_NAME
params:
$SERVICE_NAME: {get_param: ServiceName}
- str_replace:
template: tripleo_stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: RootStackName}
outputs:
ip_address:
description: Virtual IP network IP
Expand Down
1 change: 1 addition & 0 deletions overcloud.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,7 @@ resources:
- {get_param: {{network.name}}VirtualFixedIPs}
{%- endif %}
- [{subnet: {get_attr: [ServiceNetMap, vip_subnet_map, {{network.name}}]}}]
IsVirtualIP: true
{%- endfor %}

VipMap:
Expand Down

0 comments on commit 73684d0

Please sign in to comment.