Compute: Exec puppet after all configuration
authorDan Prince <dprince@redhat.com>
Thu, 19 Feb 2015 23:54:24 +0000 (15:54 -0800)
committerDan Prince <dprince@redhat.com>
Tue, 24 Feb 2015 01:45:01 +0000 (20:45 -0500)
This patch adds a new ComputeNodesPostDeployment resource
which can be used along with the environment file to
specify a nested stack which is guaranteed to execute
after all the Compute config deployments have executed.

This is really useful for Puppet in that Heat actually
controls where puppet executes in the deployment
process and we want to ensure puppet runs after
all hiera configuration data has be deployed to
the nodes. With the previous approach some of the
data would be there, but allNodes data would not be
guaranteed to be there in time.

As os-apply-config (tripleo-image-elements) have their
ordering controlled within the elements themselves an empty stubbed
in nested stack has been added so that we don't break that
implementation.

Change-Id: I80bccd692e45393f8250607073d1fe7beb0d7396

compute-post.yaml [new file with mode: 0644]
overcloud-resource-registry-puppet.yaml
overcloud-resource-registry.yaml
overcloud-without-mergepy.yaml
puppet/compute-post-puppet.yaml [new file with mode: 0644]
puppet/compute-puppet.yaml

diff --git a/compute-post.yaml b/compute-post.yaml
new file mode 100644 (file)
index 0000000..8c49709
--- /dev/null
@@ -0,0 +1,8 @@
+heat_template_version: 2014-10-16
+description: 'Compute Post Deployment'
+# NOTE: this is a noop for os-apply-config style deployments because
+# post deployment ordering is controlled by tripleo-image-elements
+
+parameters:
+  servers:
+    type: json
index b487f42..eeef6d1 100644 (file)
@@ -7,6 +7,7 @@ resource_registry:
   OS::TripleO::Net::SoftwareConfig: net-config-bridge.yaml
   OS::TripleO::CephStorage: puppet/ceph-storage-puppet.yaml
   OS::TripleO::ControllerPostDeployment: puppet/controller-post-puppet.yaml
+  OS::TripleO::ComputePostDeployment: puppet/compute-post-puppet.yaml
   OS::TripleO::SwiftDevicesAndProxy::SoftwareConfig: puppet/swift-devices-and-proxy-config.yaml
   OS::TripleO::AllNodes::SoftwareConfig: puppet/all-nodes-config.yaml
   OS::TripleO::BootstrapNode::SoftwareConfig: puppet/bootstrap-config.yaml
index 32e3ad4..9d0f653 100644 (file)
@@ -7,6 +7,7 @@ resource_registry:
   OS::TripleO::Net::SoftwareConfig: net-config-noop.yaml
   OS::TripleO::CephStorage: ceph-storage.yaml
   OS::TripleO::ControllerPostDeployment: controller-post.yaml
+  OS::TripleO::ComputePostDeployment: compute-post.yaml
   OS::TripleO::SwiftDevicesAndProxy::SoftwareConfig: swift-devices-and-proxy-config.yaml
   OS::TripleO::AllNodes::SoftwareConfig: all-nodes-config.yaml
   OS::TripleO::BootstrapNode::SoftwareConfig: bootstrap-config.yaml
index bd48ec6..3a719e3 100644 (file)
@@ -784,6 +784,12 @@ resources:
     properties:
       servers: {get_attr: [Controller, attributes, nova_server_resource]}
 
+  ComputeNodesPostDeployment:
+    type: OS::TripleO::ComputePostDeployment
+    depends_on: ComputeAllNodesDeployment
+    properties:
+      servers: {get_attr: [Compute, attributes, nova_server_resource]}
+
 outputs:
   KeystoneURL:
     description: URL for the Overcloud Keystone service
diff --git a/puppet/compute-post-puppet.yaml b/puppet/compute-post-puppet.yaml
new file mode 100644 (file)
index 0000000..9b7eb0c
--- /dev/null
@@ -0,0 +1,25 @@
+heat_template_version: 2014-10-16
+
+description: >
+  OpenStack compute node post deployment for Puppet.
+
+parameters:
+  servers:
+    type: json
+
+resources:
+
+  ComputePuppetConfig:
+    type: OS::Heat::SoftwareConfig
+    properties:
+      group: puppet
+      outputs:
+      - name: result
+      config:
+        get_file: manifests/overcloud_compute.pp
+
+  ComputePuppetDeployment:
+    type: OS::Heat::StructuredDeployments
+    properties:
+      servers:  {get_param: servers}
+      config: {get_resource: ComputePuppetConfig}
index ab2d0a3..e6b5a78 100644 (file)
@@ -260,21 +260,6 @@ resources:
         bridge_name: {get_param: NeutronPhysicalBridge}
         interface_name: {get_param: NeutronPublicInterface}
 
-  ComputePuppetConfig:
-    type: OS::Heat::SoftwareConfig
-    properties:
-      group: puppet
-      outputs:
-      - name: result
-      config:
-        get_file: manifests/overcloud_compute.pp
-
-  ComputePuppetDeployment:
-    type: OS::Heat::StructuredDeployment
-    properties:
-      server: {get_resource: NovaCompute}
-      config: {get_resource: ComputePuppetConfig}
-
   NovaComputeConfig:
     type: OS::Heat::StructuredConfig
     properties: