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

Commit

Permalink
Add hostname and stack_name tags to ports
Browse files Browse the repository at this point in the history
Set tag's with the stack name and the hostname
on composable network node ports. The tags will
be used by network-data-v2 with port management
handled outside of heat.

Change-Id: I23c600c1754d463028259a7dc2c6e5538c512ca4
  • Loading branch information
hjensas committed Nov 14, 2020
1 parent bd94c1b commit 28f2a70
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions network/ports/from_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: >
Returns an IP from a service mapped list of IPs
parameters:
StackName: # Here for compatibility
description: Name of the overcloud heat stack
default: overcloud
type: string
ServiceName:
description: Name of the service to lookup
default: ''
Expand Down
4 changes: 4 additions & 0 deletions network/ports/from_service_v6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: >
Returns an IP from a service mapped list of IPv6 IPs
parameters:
StackName: # Here for compatibility
description: Name of the overcloud heat stack
default: overcloud
type: string
ServiceName:
description: Name of the service to lookup
default: ''
Expand Down
4 changes: 4 additions & 0 deletions network/ports/noop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: >
Returns the control plane port (provisioning network) as the ip_address.
parameters:
StackName: # Here for compatibility
description: Name of the overcloud heat stack
default: overcloud
type: string
ServiceName: # Here for compatibility with from_service.yaml
description: Name of the service to lookup
default: ''
Expand Down
13 changes: 13 additions & 0 deletions network/ports/port.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ description: >
automatically if FixedIPs is empty.

parameters:
StackName:
description: Name of the overcloud heat stack
default: overcloud
type: string
{{network.name}}NetName:
description: The name of the {{network.name_lower}} network.
default: {{network.name_lower|default(network.name|lower)}}
Expand Down Expand Up @@ -81,6 +85,15 @@ resources:
- [{subnet: {get_param: ControlPlaneSubnet}}]
- get_param: FixedIPs
replacement_policy: AUTO
tags:
- str_replace:
template: hostname=$HOSTNAME
params:
$HOSTNAME: {get_param: DnsName}
- str_replace:
template: stack_name=$STACK_NAME
params:
$STACK_NAME: {get_param: StackName}

outputs:
ip_address:
Expand Down
4 changes: 4 additions & 0 deletions network/ports/port_from_pool.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ description: >
- 1.2.3.5 # Second controller

parameters:
StackName: # Here for compatibility
description: Name of the overcloud heat stack
default: overcloud
type: string
{{network.name}}NetName:
description: The name of the {{network.name_lower}} network.
default: {{network.name_lower}}
Expand Down
1 change: 1 addition & 0 deletions overcloud.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ resources:
resource_def:
type: OS::TripleO::{{role.name}}
properties:
StackName: {get_param: 'OS::stack_name'}
CloudDomain: {get_param: CloudDomain}
ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
EndpointMap: {get_attr: [EndpointMapData, value]}
Expand Down
5 changes: 5 additions & 0 deletions puppet/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
heat_template_version: rocky
description: 'OpenStack {{role.name}} node configured by Puppet'
parameters:
StackName:
description: Name of the overcloud heat stack
default: overcloud
type: string
{%- set default_flavor_name = role.FlavorDefault|default('baremetal') %}
{%- if role.deprecated_param_flavor is defined %}
{{role.deprecated_param_flavor}}:
Expand Down Expand Up @@ -300,6 +304,7 @@ resources:
{{network.name}}Port:
type: OS::TripleO::{{role.name}}::Ports::{{network.name}}Port
properties:
StackName: {get_param: StackName}
PortName:
list_join:
- '_'
Expand Down

0 comments on commit 28f2a70

Please sign in to comment.