aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--overcloud-resource-registry-puppet.yaml1
-rw-r--r--puppet/ceph-storage.yaml14
-rw-r--r--puppet/cinder-storage.yaml1
-rw-r--r--puppet/compute.yaml1
-rw-r--r--puppet/controller.yaml1
-rw-r--r--puppet/extraconfig/pre_deploy/per_node.yaml56
-rw-r--r--puppet/swift-storage.yaml1
7 files changed, 74 insertions, 1 deletions
diff --git a/overcloud-resource-registry-puppet.yaml b/overcloud-resource-registry-puppet.yaml
index c5e5fdea..b527c10f 100644
--- a/overcloud-resource-registry-puppet.yaml
+++ b/overcloud-resource-registry-puppet.yaml
@@ -34,6 +34,7 @@ resource_registry:
OS::TripleO::NodeUserData: firstboot/userdata_default.yaml
OS::TripleO::ControllerExtraConfigPre: puppet/extraconfig/pre_deploy/default.yaml
OS::TripleO::ComputeExtraConfigPre: puppet/extraconfig/pre_deploy/default.yaml
+ OS::TripleO::CephStorageExtraConfigPre: puppet/extraconfig/pre_deploy/default.yaml
OS::TripleO::NodeExtraConfigPost: extraconfig/post_deploy/default.yaml
# "AllNodes" Extra cluster config, runs on all nodes prior to the post_deploy
diff --git a/puppet/ceph-storage.yaml b/puppet/ceph-storage.yaml
index 4b4c76fc..87957052 100644
--- a/puppet/ceph-storage.yaml
+++ b/puppet/ceph-storage.yaml
@@ -149,6 +149,7 @@ resources:
config:
hiera:
hierarchy:
+ - '"%{::uuid}"'
- heat_config_%{::deploy_config_name}
- ceph_extraconfig
- extraconfig
@@ -171,6 +172,13 @@ resources:
ceph::profile::params::cluster_network: {get_input: ceph_cluster_network}
ceph::profile::params::public_network: {get_input: ceph_public_network}
+ # Hook for site-specific additional pre-deployment config, e.g extra hieradata
+ CephStorageExtraConfigPre:
+ depends_on: CephStorageDeployment
+ type: OS::TripleO::CephStorageExtraConfigPre
+ properties:
+ server: {get_resource: CephStorage}
+
UpdateConfig:
type: OS::TripleO::Tasks::PackageUpdate
@@ -203,4 +211,8 @@ outputs:
value: {get_attr: [StorageMgmtPort, ip_address]}
config_identifier:
description: identifier which changes if the node configuration may need re-applying
- value: {get_attr: [CephStorageDeployment, deploy_stdout]}
+ value:
+ list_join:
+ - ','
+ - - {get_attr: [CephStorageDeployment, deploy_stdout]}
+ - {get_attr: [CephStorageExtraConfigPre, deploy_stdout]}
diff --git a/puppet/cinder-storage.yaml b/puppet/cinder-storage.yaml
index f597512a..1cc300cc 100644
--- a/puppet/cinder-storage.yaml
+++ b/puppet/cinder-storage.yaml
@@ -226,6 +226,7 @@ resources:
config:
hiera:
hierarchy:
+ - '"%{::uuid}"'
- heat_config_%{::deploy_config_name}
- volume_extraconfig
- extraconfig
diff --git a/puppet/compute.yaml b/puppet/compute.yaml
index 99a54e08..a7c1c8c9 100644
--- a/puppet/compute.yaml
+++ b/puppet/compute.yaml
@@ -350,6 +350,7 @@ resources:
config:
hiera:
hierarchy:
+ - '"%{::uuid}"'
- heat_config_%{::deploy_config_name}
- compute_extraconfig
- extraconfig
diff --git a/puppet/controller.yaml b/puppet/controller.yaml
index 57158e5a..a68ece2b 100644
--- a/puppet/controller.yaml
+++ b/puppet/controller.yaml
@@ -930,6 +930,7 @@ resources:
config:
hiera:
hierarchy:
+ - '"%{::uuid}"'
- heat_config_%{::deploy_config_name}
- controller_extraconfig
- extraconfig
diff --git a/puppet/extraconfig/pre_deploy/per_node.yaml b/puppet/extraconfig/pre_deploy/per_node.yaml
new file mode 100644
index 00000000..80c8ad6e
--- /dev/null
+++ b/puppet/extraconfig/pre_deploy/per_node.yaml
@@ -0,0 +1,56 @@
+heat_template_version: 2015-04-30
+
+description: Configure hieradata overrides for specific nodes
+
+parameters:
+ server:
+ description: ID of the controller node to apply this config to
+ type: string
+
+ # Config specific parameters, to be provided via parameter_defaults
+ # This would be a lookup of the node UUID as provided by dmidecode
+ # to the json required for the node-specific hieradata
+ # Note this needs to be a json blob e.g:
+ # parameter_defaults:
+ # NodeDataLookup: |
+ # {"AB4114B1-9C9D-409A-BEFB-D88C151BF2C3": {"foo": "bar"},
+ # "8CF1A7EA-7B4B-4433-AC83-17675514B1B8": {"foo2": "bar2"}}
+ NodeDataLookup:
+ type: string
+ default: ''
+ description: json string containing per-node configuration map
+
+resources:
+ NodeSpecificConfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ inputs:
+ - name: node_lookup
+ config: |
+ #!/bin/sh
+ node_id=$(dmidecode --s system-uuid)
+
+ # Create a /etc/puppet/hieradata/UUID.json file to provide
+ # the data of the NodeDataLookup parameter that matches the
+ # system UUID
+ echo $node_lookup | python -c "
+ import json
+ import sys
+ input = sys.stdin.readline() or '{}'
+ cnt = json.loads(input)
+ print json.dumps(cnt.get('${node_id}', {}))
+ " > /etc/puppet/hieradata/${node_id}.json
+
+ NodeSpecificDeployment:
+ type: OS::Heat::SoftwareDeployment
+ properties:
+ config: {get_resource: NodeSpecificConfig}
+ server: {get_param: server}
+ input_values:
+ node_lookup: {get_param: NodeDataLookup}
+
+outputs:
+ deploy_stdout:
+ description: Deployment reference, used to trigger puppet apply on changes
+ value: {get_attr: [NodeSpecificDeployment, deploy_stdout]}
diff --git a/puppet/swift-storage.yaml b/puppet/swift-storage.yaml
index 67617771..c09b4e45 100644
--- a/puppet/swift-storage.yaml
+++ b/puppet/swift-storage.yaml
@@ -156,6 +156,7 @@ resources:
config:
hiera:
hierarchy:
+ - '"%{::uuid}"'
- heat_config_%{::deploy_config_name}
- object_extraconfig
- extraconfig