Add AllNodesExtraMapData parameter
The AllNodesExtraMapData parameter is used to inject additional hieradata into the all_nodes hierdata file on each node. The injected data will be deeploy merged with the calculated all_nodes data for the stack. The parameter can be taken advantage of for split-controlplane use cases where the hieradata from the control stack needs to be populated into the separate compute stacks. To easily get the hieradata out of the control stack, a new stack output is added, AllNodesConfig. Partially Implements: blueprint split-controlplane Change-Id: I7b865bf82520006eef3ac2f36df34b1f3c34e642
This commit is contained in:
parent
66872cc8d9
commit
7f42272024
@ -1043,3 +1043,6 @@ outputs:
|
|||||||
BlacklistedHostnames:
|
BlacklistedHostnames:
|
||||||
description: List of blacklisted hostnames
|
description: List of blacklisted hostnames
|
||||||
value: {get_attr: [BlacklistedHostnames, value]}
|
value: {get_attr: [BlacklistedHostnames, value]}
|
||||||
|
AllNodesConfig:
|
||||||
|
description: The config (hieradata) for all nodes.
|
||||||
|
value: {get_attr: [allNodesConfig, all_nodes_config]}
|
||||||
|
@ -61,6 +61,10 @@ parameters:
|
|||||||
EnableInternalTLS:
|
EnableInternalTLS:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
AllNodesExtraMapData:
|
||||||
|
type: json
|
||||||
|
default: {}
|
||||||
|
description: Map of extra data (hieradata) to set on each node.
|
||||||
|
|
||||||
{%- for network in networks %}
|
{%- for network in networks %}
|
||||||
{{network.name}}NetName:
|
{{network.name}}NetName:
|
||||||
@ -71,6 +75,79 @@ parameters:
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
||||||
|
allNodesConfigValue:
|
||||||
|
type: OS::Heat::Value
|
||||||
|
properties:
|
||||||
|
value:
|
||||||
|
yaql:
|
||||||
|
expression: $.data.all_nodes_extra_map_data.mergeWith($.data.all_nodes)
|
||||||
|
data:
|
||||||
|
all_nodes_extra_map_data: {get_param: AllNodesExtraMapData}
|
||||||
|
all_nodes:
|
||||||
|
map_merge:
|
||||||
|
- enabled_services:
|
||||||
|
yaql:
|
||||||
|
expression: $.data.distinct()
|
||||||
|
data: {get_param: enabled_services}
|
||||||
|
# This writes out a mapping of service_name_enabled: 'true'
|
||||||
|
# For any services not enabled, hiera foo_enabled will
|
||||||
|
# return nil, as it's undefined
|
||||||
|
- map_merge:
|
||||||
|
repeat:
|
||||||
|
template:
|
||||||
|
# Note this must be string 'true' due to
|
||||||
|
# https://bugs.launchpad.net/heat/+bug/1617203
|
||||||
|
SERVICE_enabled: 'true'
|
||||||
|
for_each:
|
||||||
|
SERVICE: {get_param: enabled_services}
|
||||||
|
# Dynamically generate per-service network data
|
||||||
|
# This works as follows (outer->inner functions)
|
||||||
|
# yaql - filters services where no mapping exists in ServiceNetMap
|
||||||
|
# map_replace: substitute e.g heat_api_network with network name from ServiceNetMap
|
||||||
|
# map_merge/repeat: generate a per-service mapping
|
||||||
|
- yaql:
|
||||||
|
# This filters any entries where the value hasn't been substituted for
|
||||||
|
# a list, e.g it's still $service_network. This happens when there is
|
||||||
|
# no network defined for the service in the ServiceNetMap, which is OK
|
||||||
|
# as not all services have to be bound to a network, so we filter them
|
||||||
|
expression: dict($.data.map.items().where(isString($[1]) and not $[1].endsWith("_network")))
|
||||||
|
data:
|
||||||
|
map:
|
||||||
|
map_replace:
|
||||||
|
- map_merge:
|
||||||
|
repeat:
|
||||||
|
template:
|
||||||
|
SERVICE_network: SERVICE_network
|
||||||
|
for_each:
|
||||||
|
SERVICE: {get_param: enabled_services}
|
||||||
|
- values: {get_param: ServiceNetMap}
|
||||||
|
# Keystone doesn't provide separate entries for the public
|
||||||
|
# and admin endpoints, so we need to add them here manually
|
||||||
|
# like we do in the vip-config below
|
||||||
|
- keystone_admin_api_network: {get_param: [ServiceNetMap, keystone_admin_api_network]}
|
||||||
|
keystone_public_api_network: {get_param: [ServiceNetMap, keystone_public_api_network]}
|
||||||
|
# provides a mapping of service_name_ips to a list of IPs
|
||||||
|
- {get_param: service_ips}
|
||||||
|
- {get_param: service_node_names}
|
||||||
|
- {get_param: short_service_node_names}
|
||||||
|
- {get_param: short_service_bootstrap_node}
|
||||||
|
- controller_node_ips:
|
||||||
|
list_join:
|
||||||
|
- ','
|
||||||
|
- {get_param: controller_ips}
|
||||||
|
controller_node_names:
|
||||||
|
list_join:
|
||||||
|
- ','
|
||||||
|
- {get_param: controller_names}
|
||||||
|
- cellv2_discovery_hosts:
|
||||||
|
list_join:
|
||||||
|
- ','
|
||||||
|
- {get_param: cellv2_discovery_hosts}
|
||||||
|
deploy_identifier: {get_param: DeployIdentifier}
|
||||||
|
update_identifier: {get_param: UpdateIdentifier}
|
||||||
|
stack_action: {get_param: StackAction}
|
||||||
|
stack_update_type: {get_param: StackUpdateType}
|
||||||
|
|
||||||
allNodesConfigImpl:
|
allNodesConfigImpl:
|
||||||
type: OS::Heat::StructuredConfig
|
type: OS::Heat::StructuredConfig
|
||||||
properties:
|
properties:
|
||||||
@ -80,70 +157,7 @@ resources:
|
|||||||
bootstrap_node:
|
bootstrap_node:
|
||||||
bootstrap_nodeid: {get_input: bootstrap_nodeid}
|
bootstrap_nodeid: {get_input: bootstrap_nodeid}
|
||||||
bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
|
bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
|
||||||
all_nodes:
|
all_nodes: {get_attr: [allNodesConfigValue, value]}
|
||||||
map_merge:
|
|
||||||
- enabled_services:
|
|
||||||
yaql:
|
|
||||||
expression: $.data.distinct()
|
|
||||||
data: {get_param: enabled_services}
|
|
||||||
# This writes out a mapping of service_name_enabled: 'true'
|
|
||||||
# For any services not enabled, hiera foo_enabled will
|
|
||||||
# return nil, as it's undefined
|
|
||||||
- map_merge:
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
# Note this must be string 'true' due to
|
|
||||||
# https://bugs.launchpad.net/heat/+bug/1617203
|
|
||||||
SERVICE_enabled: 'true'
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_param: enabled_services}
|
|
||||||
# Dynamically generate per-service network data
|
|
||||||
# This works as follows (outer->inner functions)
|
|
||||||
# yaql - filters services where no mapping exists in ServiceNetMap
|
|
||||||
# map_replace: substitute e.g heat_api_network with network name from ServiceNetMap
|
|
||||||
# map_merge/repeat: generate a per-service mapping
|
|
||||||
- yaql:
|
|
||||||
# This filters any entries where the value hasn't been substituted for
|
|
||||||
# a list, e.g it's still $service_network. This happens when there is
|
|
||||||
# no network defined for the service in the ServiceNetMap, which is OK
|
|
||||||
# as not all services have to be bound to a network, so we filter them
|
|
||||||
expression: dict($.data.map.items().where(isString($[1]) and not $[1].endsWith("_network")))
|
|
||||||
data:
|
|
||||||
map:
|
|
||||||
map_replace:
|
|
||||||
- map_merge:
|
|
||||||
repeat:
|
|
||||||
template:
|
|
||||||
SERVICE_network: SERVICE_network
|
|
||||||
for_each:
|
|
||||||
SERVICE: {get_param: enabled_services}
|
|
||||||
- values: {get_param: ServiceNetMap}
|
|
||||||
# Keystone doesn't provide separate entries for the public
|
|
||||||
# and admin endpoints, so we need to add them here manually
|
|
||||||
# like we do in the vip-config below
|
|
||||||
- keystone_admin_api_network: {get_param: [ServiceNetMap, keystone_admin_api_network]}
|
|
||||||
keystone_public_api_network: {get_param: [ServiceNetMap, keystone_public_api_network]}
|
|
||||||
# provides a mapping of service_name_ips to a list of IPs
|
|
||||||
- {get_param: service_ips}
|
|
||||||
- {get_param: service_node_names}
|
|
||||||
- {get_param: short_service_node_names}
|
|
||||||
- {get_param: short_service_bootstrap_node}
|
|
||||||
- controller_node_ips:
|
|
||||||
list_join:
|
|
||||||
- ','
|
|
||||||
- {get_param: controller_ips}
|
|
||||||
controller_node_names:
|
|
||||||
list_join:
|
|
||||||
- ','
|
|
||||||
- {get_param: controller_names}
|
|
||||||
- cellv2_discovery_hosts:
|
|
||||||
list_join:
|
|
||||||
- ','
|
|
||||||
- {get_param: cellv2_discovery_hosts}
|
|
||||||
deploy_identifier: {get_param: DeployIdentifier}
|
|
||||||
update_identifier: {get_param: UpdateIdentifier}
|
|
||||||
stack_action: {get_param: StackAction}
|
|
||||||
stack_update_type: {get_param: StackUpdateType}
|
|
||||||
vip_data:
|
vip_data:
|
||||||
map_merge:
|
map_merge:
|
||||||
# Dynamically generate per-service VIP data based on enabled_services
|
# Dynamically generate per-service VIP data based on enabled_services
|
||||||
@ -211,3 +225,6 @@ outputs:
|
|||||||
description: The ID of the allNodesConfigImpl resource.
|
description: The ID of the allNodesConfigImpl resource.
|
||||||
value:
|
value:
|
||||||
{get_resource: allNodesConfigImpl}
|
{get_resource: allNodesConfigImpl}
|
||||||
|
all_nodes_config:
|
||||||
|
description: The all_nodes hieradata config
|
||||||
|
value: {get_attr: [allNodesConfigValue, value]}
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- AllNodesExtraMapData is a new parameter that can be used to inject
|
||||||
|
additional hieradata into the all_nodes.yaml hieradata file on each node.
|
||||||
|
The injected data will be deeply merged with the new all_nodes hieradata
|
||||||
|
calculated for the stack.
|
Loading…
Reference in New Issue
Block a user