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:
James Slagle 2018-07-09 12:17:00 -04:00
parent 66872cc8d9
commit 7f42272024
3 changed files with 90 additions and 64 deletions

View File

@ -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]}

View File

@ -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,15 +75,14 @@ parameters:
resources: resources:
allNodesConfigImpl: allNodesConfigValue:
type: OS::Heat::StructuredConfig type: OS::Heat::Value
properties: properties:
group: hiera value:
config: yaql:
datafiles: expression: $.data.all_nodes_extra_map_data.mergeWith($.data.all_nodes)
bootstrap_node: data:
bootstrap_nodeid: {get_input: bootstrap_nodeid} all_nodes_extra_map_data: {get_param: AllNodesExtraMapData}
bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
all_nodes: all_nodes:
map_merge: map_merge:
- enabled_services: - enabled_services:
@ -144,6 +147,17 @@ resources:
update_identifier: {get_param: UpdateIdentifier} update_identifier: {get_param: UpdateIdentifier}
stack_action: {get_param: StackAction} stack_action: {get_param: StackAction}
stack_update_type: {get_param: StackUpdateType} stack_update_type: {get_param: StackUpdateType}
allNodesConfigImpl:
type: OS::Heat::StructuredConfig
properties:
group: hiera
config:
datafiles:
bootstrap_node:
bootstrap_nodeid: {get_input: bootstrap_nodeid}
bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
all_nodes: {get_attr: [allNodesConfigValue, value]}
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]}

View File

@ -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.