Make ServiceNetMap support custom network names
The rework to support custom roles moved the service net map
into a nested stack, but the logic it contains fails to consider
operators may override the network names via *NetName parameters.
So add a map_replace of the ServiceNetMapDefaults so we maintain
the existing default service->network assignments, even when the
network name is changed.
Note that operators will still be expected to pass any ServiceNetMap
overrides with the "new" network name, e.g whatever *NetName specifies,
otherwise I think environment files could get very confusing.
Change-Id: I52018e19428e11d26650f0ea6ccee3ae02494ff8
Partial-Bug: #1651541
(cherry picked from commit 24952e016f
)
This commit is contained in:
parent
3481a84fa5
commit
0d0e5c8f63
|
@ -21,6 +21,9 @@ parameters:
|
||||||
# snake_case - the names must still match when converted
|
# snake_case - the names must still match when converted
|
||||||
ServiceNetMapDefaults:
|
ServiceNetMapDefaults:
|
||||||
default:
|
default:
|
||||||
|
# Note the values in this map are replaced by *NetName
|
||||||
|
# to allow for sane defaults when the network names are
|
||||||
|
# overridden.
|
||||||
ApacheNetwork: internal_api
|
ApacheNetwork: internal_api
|
||||||
NeutronTenantNetwork: tenant
|
NeutronTenantNetwork: tenant
|
||||||
CeilometerApiNetwork: internal_api
|
CeilometerApiNetwork: internal_api
|
||||||
|
@ -79,20 +82,62 @@ parameters:
|
||||||
internal use only, this will be removed in future.
|
internal use only, this will be removed in future.
|
||||||
type: json
|
type: json
|
||||||
|
|
||||||
|
InternalApiNetName:
|
||||||
|
default: internal_api
|
||||||
|
description: The name of the internal API network.
|
||||||
|
type: string
|
||||||
|
ExternalNetName:
|
||||||
|
default: external
|
||||||
|
description: The name of the external network.
|
||||||
|
type: string
|
||||||
|
ManagementNetName:
|
||||||
|
default: management
|
||||||
|
description: The name of the management network.
|
||||||
|
type: string
|
||||||
|
StorageNetName:
|
||||||
|
default: storage
|
||||||
|
description: The name of the storage network.
|
||||||
|
type: string
|
||||||
|
StorageMgmtNetName:
|
||||||
|
default: storage_mgmt
|
||||||
|
description: The name of the Storage management network.
|
||||||
|
type: string
|
||||||
|
TenantNetName:
|
||||||
|
default: tenant
|
||||||
|
description: The name of the tenant network.
|
||||||
|
type: string
|
||||||
|
|
||||||
|
|
||||||
parameter_groups:
|
parameter_groups:
|
||||||
- label: deprecated
|
- label: deprecated
|
||||||
description: Do not use deprecated params, they will be removed.
|
description: Do not use deprecated params, they will be removed.
|
||||||
parameters:
|
parameters:
|
||||||
- ServiceNetMapDeprecatedMapping
|
- ServiceNetMapDeprecatedMapping
|
||||||
|
|
||||||
|
resources:
|
||||||
|
ServiceNetMapValue:
|
||||||
|
type: OS::Heat::Value
|
||||||
|
properties:
|
||||||
|
type: json
|
||||||
|
value:
|
||||||
|
map_merge:
|
||||||
|
- map_replace:
|
||||||
|
- {get_param: ServiceNetMapDefaults}
|
||||||
|
- values:
|
||||||
|
external: {get_param: ExternalNetName}
|
||||||
|
internal_api: {get_param: InternalApiNetName}
|
||||||
|
storage: {get_param: StorageNetName}
|
||||||
|
storage_mgmt: {get_param: StorageMgmtNetName}
|
||||||
|
tenant: {get_param: TenantNetName}
|
||||||
|
management: {get_param: ManagementNetName}
|
||||||
|
- map_replace:
|
||||||
|
- {get_param: ServiceNetMap}
|
||||||
|
- keys: {get_param: ServiceNetMapDeprecatedMapping}
|
||||||
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
service_net_map:
|
service_net_map:
|
||||||
value:
|
value: {get_attr: [ServiceNetMapValue, value]}
|
||||||
map_merge:
|
|
||||||
- {get_param: ServiceNetMapDefaults}
|
|
||||||
- map_replace:
|
|
||||||
- {get_param: ServiceNetMap}
|
|
||||||
- keys: {get_param: ServiceNetMapDeprecatedMapping}
|
|
||||||
|
|
||||||
service_net_map_lower:
|
service_net_map_lower:
|
||||||
value:
|
value:
|
||||||
|
@ -102,9 +147,4 @@ outputs:
|
||||||
yaql:
|
yaql:
|
||||||
expression: dict($.data.map.items().select([ regex(`([a-z0-9])([A-Z])`).replace($[0], '\\1_\\2').toLower(), $[1]]))
|
expression: dict($.data.map.items().select([ regex(`([a-z0-9])([A-Z])`).replace($[0], '\\1_\\2').toLower(), $[1]]))
|
||||||
data:
|
data:
|
||||||
map:
|
map: {get_attr: [ServiceNetMapValue, value]}
|
||||||
map_merge:
|
|
||||||
- {get_param: ServiceNetMapDefaults}
|
|
||||||
- map_replace:
|
|
||||||
- {get_param: ServiceNetMap}
|
|
||||||
- keys: {get_param: ServiceNetMapDeprecatedMapping}
|
|
||||||
|
|
Loading…
Reference in New Issue