Combine BootstrapNodeDeployment with AllNodesDeployment

Currently we have a special controller-only deployment which writes
the name/ip of the "bootstrap node", e.g the cluster master, which
defaults to the first node in the Controller ResourceGroup.

Now we're moving to fully composable services/roles, it's possible
folks will want to deploy services that expect to detect the bootstrap
node (e.g so only one node does a DB sync) for non-controller roles.

So, take this opportunity to combine the bootstrap node deployment with
the "all nodes" data, such that we deploy the same data for all roles.

Because the boostrap node data is per role cluster, rather than truly
global, we pass it via input_values into each per-role Deployment.

At some future point we might consider renaming this, e.g to
something which describes per-cluster config vs "all nodes",
but as a first step let's just rationalize the resources.

Change-Id: I4011526a13c51b3d0f95c17fe8ed38115b4fdce4
This commit is contained in:
Steven Hardy 2016-07-04 16:28:41 +01:00
parent 519b94ff1e
commit b345dbea16
7 changed files with 38 additions and 43 deletions

View File

@ -20,7 +20,6 @@ resource_registry:
OS::TripleO::SwiftDevicesAndProxy::SoftwareConfig: puppet/swift-devices-and-proxy-config.yaml
OS::TripleO::CephClusterConfig::SoftwareConfig: puppet/ceph-cluster-config.yaml
OS::TripleO::AllNodes::SoftwareConfig: puppet/all-nodes-config.yaml
OS::TripleO::BootstrapNode::SoftwareConfig: puppet/bootstrap-config.yaml
# Tasks (for internal TripleO usage)
OS::TripleO::Tasks::UpdateWorkflow: OS::Heat::None

View File

@ -1209,19 +1209,6 @@ resources:
storage_virtual_ip: {get_attr: [VipMap, net_ip_map, storage]}
storage_mgmt_virtual_ip: {get_attr: [VipMap, net_ip_map, storage_mgmt]}
ControllerBootstrapNodeConfig:
type: OS::TripleO::BootstrapNode::SoftwareConfig
properties:
bootstrap_nodeid: {get_attr: [Controller, resource.0.hostname]}
bootstrap_nodeid_ip: {get_attr: [Controller, resource.0.ip_address]}
ControllerBootstrapNodeDeployment:
type: OS::Heat::StructuredDeployments
properties:
name: ControllerBootstrapNodeDeployment
config: {get_attr: [ControllerBootstrapNodeConfig, config_id]}
servers: {get_attr: [Controller, attributes, nova_server_resource]}
ControllerSwiftDeployment:
type: OS::Heat::StructuredDeployments
properties:
@ -1273,6 +1260,9 @@ resources:
name: ControllerAllNodesDeployment
config: {get_attr: [allNodesConfig, config_id]}
servers: {get_attr: [Controller, attributes, nova_server_resource]}
input_values:
bootstrap_nodeid: {get_attr: [Controller, resource.0.hostname]}
bootstrap_nodeid_ip: {get_attr: [Controller, resource.0.ip_address]}
ComputeAllNodesDeployment:
type: OS::Heat::StructuredDeployments
@ -1280,6 +1270,9 @@ resources:
name: ComputeAllNodesDeployment
config: {get_attr: [allNodesConfig, config_id]}
servers: {get_attr: [Compute, attributes, nova_server_resource]}
input_values:
bootstrap_nodeid: {get_attr: [Compute, resource.0.hostname]}
bootstrap_nodeid_ip: {get_attr: [Compute, resource.0.ip_address]}
BlockStorageAllNodesDeployment:
type: OS::Heat::StructuredDeployments
@ -1287,6 +1280,9 @@ resources:
name: BlockStorageAllNodesDeployment
config: {get_attr: [allNodesConfig, config_id]}
servers: {get_attr: [BlockStorage, attributes, nova_server_resource]}
input_values:
bootstrap_nodeid: {get_attr: [BlockStorage, resource.0.hostname]}
bootstrap_nodeid_ip: {get_attr: [BlockStorage, resource.0.ip_address]}
ObjectStorageAllNodesDeployment:
type: OS::Heat::StructuredDeployments
@ -1294,6 +1290,9 @@ resources:
name: ObjectStorageAllNodesDeployment
config: {get_attr: [allNodesConfig, config_id]}
servers: {get_attr: [ObjectStorage, attributes, nova_server_resource]}
input_values:
bootstrap_nodeid: {get_attr: [ObjectStorage, resource.0.hostname]}
bootstrap_nodeid_ip: {get_attr: [ObjectStorage, resource.0.ip_address]}
CephStorageAllNodesDeployment:
type: OS::Heat::StructuredDeployments
@ -1301,6 +1300,9 @@ resources:
name: CephStorageAllNodesDeployment
config: {get_attr: [allNodesConfig, config_id]}
servers: {get_attr: [CephStorage, attributes, nova_server_resource]}
input_values:
bootstrap_nodeid: {get_attr: [CephStorage, resource.0.hostname]}
bootstrap_nodeid_ip: {get_attr: [CephStorage, resource.0.ip_address]}
# All Nodes Validations
AllNodesValidationConfig:
@ -1388,7 +1390,7 @@ resources:
# Nested stack deployment runs after all other controller deployments
ControllerNodesPostDeployment:
type: OS::TripleO::ControllerPostDeployment
depends_on: [ControllerBootstrapNodeDeployment, ControllerAllNodesDeployment, ControllerSwiftDeployment, ControllerCephDeployment]
depends_on: [ControllerAllNodesDeployment, ControllerSwiftDeployment, ControllerCephDeployment]
properties:
servers: {get_attr: [Controller, attributes, nova_server_resource]}
RoleData: {get_attr: [ControllerServiceChain, role_data]}

View File

@ -108,6 +108,10 @@ resources:
datafiles:
RedHat:
raw_data: {get_file: hieradata/RedHat.yaml}
bootstrap_node:
mapped_data:
bootstrap_nodeid: {get_input: bootstrap_nodeid}
bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
all_nodes:
mapped_data:
controller_node_ips:

View File

@ -1,28 +0,0 @@
heat_template_version: 2015-04-30
description: 'Bootstrap Config Puppet'
parameters:
bootstrap_nodeid:
type: string
bootstrap_nodeid_ip:
type: string
resources:
BootstrapNodeConfigImpl:
type: OS::Heat::StructuredConfig
properties:
group: os-apply-config
config:
hiera:
datafiles:
bootstrap_node:
mapped_data:
bootstrap_nodeid: {get_param: bootstrap_nodeid}
bootstrap_nodeid_ip: {get_param: bootstrap_nodeid_ip}
outputs:
config_id:
description: The ID of the BootstrapNodeConfigImpl resource.
value:
{get_resource: BootstrapNodeConfigImpl}

View File

@ -305,6 +305,12 @@ resources:
get_param: UpdateIdentifier
outputs:
ip_address:
description: IP address of the server in the ctlplane network
value: {get_attr: [CephStorage, networks, ctlplane, 0]}
hostname:
description: Hostname of the server
value: {get_attr: [CephStorage, name]}
hosts_entry:
value:
str_replace:

View File

@ -306,6 +306,12 @@ resources:
get_param: UpdateIdentifier
outputs:
ip_address:
description: IP address of the server in the ctlplane network
value: {get_attr: [BlockStorage, networks, ctlplane, 0]}
hostname:
description: Hostname of the server
value: {get_attr: [BlockStorage, name]}
hosts_entry:
value:
str_replace:

View File

@ -333,6 +333,12 @@ resources:
get_param: UpdateIdentifier
outputs:
ip_address:
description: IP address of the server in the ctlplane network
value: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
hostname:
description: Hostname of the server
value: {get_attr: [SwiftStorage, name]}
hosts_entry:
value:
str_replace: