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

Commit

Permalink
Merge "OVNChassisMacPorts for distributed VLAN" into stable/ussuri
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Apr 3, 2021
2 parents 87c763f + 2a97154 commit db82e6e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions overcloud.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ resources:
- {get_param: {{role.name}}SchedulerHints}
ServiceNames: {get_attr: [{{role.name}}ServiceNames, value]}
ServiceMetadataSettings: {get_attr: [{{role.name}}ServiceChainRoleData, value, service_metadata_settings]}
OVNBridgeMappings: {get_attr: [{{role.name}}ServiceChainRoleData, value, config_settings, 'ovn::controller::ovn_bridge_mappings']}
DeploymentServerBlacklistDict: {get_attr: [DeploymentServerBlacklistDict, value]}
RoleParameters:
map_merge:
Expand Down
34 changes: 34 additions & 0 deletions puppet/role.role.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ parameters:
ServiceMetadataSettings:
type: json
default: {}
OVNBridgeMappings:
type: comma_delimited_list
default: []
ConfigCommand:
type: string
description: Command which will be run whenever configuration data changes
Expand Down Expand Up @@ -596,6 +599,37 @@ resources:
fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
hostname_resolve_network: {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}
ovn_chassis_mac_map: {get_attr: [{{server_resource_name}}OVNChassisMacMap, value]}

{{server_resource_name}}OVNChassisMacPorts:
type: OS::Heat::ResourceGroup
properties:
count:
yaql:
expression: $.data.len()
data: {get_param: OVNBridgeMappings}
resource_def:
type: OS::TripleO::OVNMacAddressPort
properties:
PortName: {{server_resource_name}}-ovn-mac-%index%

{{server_resource_name}}OVNChassisMacMap:
type: OS::Heat::Value
properties:
type: json
value:
yaql:
expression: let(physnets => switch(isList($.data.physnets) => $.data.physnets, true => [])) ->
$physnets.zip($.data.macs).toDict($.first(), $.last())
data:
physnets:
yaql:
expression: $.data.select($.split(':').first())
data: {get_param: OVNBridgeMappings}
macs:
yaql:
expression: switch(isDict($.data) => $.data.values(), true => [])
data: {get_attr: [{{server_resource_name}}OVNChassisMacPorts, attributes, mac_address]}

outputs:
ansible_host_vars_map:
Expand Down

0 comments on commit db82e6e

Please sign in to comment.