Merge "Add AllNodesExtraMapData parameter"

This commit is contained in:
Zuul 2018-07-20 13:28:09 +00:00 committed by Gerrit Code Review
commit ce2aa5b4dc
3 changed files with 90 additions and 64 deletions

View File

@ -1043,3 +1043,6 @@ outputs:
BlacklistedHostnames:
description: List of blacklisted hostnames
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:
type: boolean
default: false
AllNodesExtraMapData:
type: json
default: {}
description: Map of extra data (hieradata) to set on each node.
{%- for network in networks %}
{{network.name}}NetName:
@ -71,15 +75,14 @@ parameters:
resources:
allNodesConfigImpl:
type: OS::Heat::StructuredConfig
allNodesConfigValue:
type: OS::Heat::Value
properties:
group: hiera
config:
datafiles:
bootstrap_node:
bootstrap_nodeid: {get_input: bootstrap_nodeid}
bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
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:
@ -144,6 +147,17 @@ resources:
update_identifier: {get_param: UpdateIdentifier}
stack_action: {get_param: StackAction}
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:
map_merge:
# Dynamically generate per-service VIP data based on enabled_services
@ -211,3 +225,6 @@ outputs:
description: The ID of the allNodesConfigImpl resource.
value:
{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.