Split out allNodesConfig SoftwareConfig
authorDan Prince <dprince@redhat.com>
Fri, 13 Feb 2015 02:54:57 +0000 (21:54 -0500)
committerGiulio Fidente <gfidente@redhat.com>
Fri, 13 Feb 2015 11:11:12 +0000 (06:11 -0500)
This patch splits out the allNodesConfig config
such that alternate implementation (puppet for example)
can implement their own SoftwareConfig's via a nested stack.

This is controlled by the standard overcloud heat environment.

For os-apply-config deployments the implementation should work the
same as before.

For puppet deployments the implementation uses hiera metadata
to configure rabbit_nodes. The puppet deployment doesn't support
hosts, or freeform sysctl metadata yet so those are the same
for now as well.

Change-Id: I34ae30b1f37aca8b39586f7e350511462d66f694

all-nodes-config.yaml [new file with mode: 0644]
overcloud-resource-registry-puppet.yaml
overcloud-resource-registry.yaml
overcloud-without-mergepy.yaml
puppet/all-nodes-config.yaml [new file with mode: 0644]
puppet/controller-puppet.yaml

diff --git a/all-nodes-config.yaml b/all-nodes-config.yaml
new file mode 100644 (file)
index 0000000..677c12d
--- /dev/null
@@ -0,0 +1,57 @@
+heat_template_version: 2014-10-16
+description: 'All Nodes Config'
+
+parameters:
+  compute_hosts:
+    type: comma_delimited_list
+  controller_hosts:
+    type: comma_delimited_list
+  block_storage_hosts:
+    type: comma_delimited_list
+  object_storage_hosts:
+    type: comma_delimited_list
+  ceph_storage_hosts:
+    type: comma_delimited_list
+  controller_names:
+    type: comma_delimited_list
+
+resources:
+
+  allNodesConfigImpl:
+    type: OS::Heat::StructuredConfig
+    properties:
+      config:
+        completion-signal: {get_input: deploy_signal_id}
+        hosts:
+          list_join:
+          - "\n"
+          - - list_join:
+              - "\n"
+              - {get_param: compute_hosts}
+            - list_join:
+              - "\n"
+              - {get_param: controller_hosts}
+            - list_join:
+              - "\n"
+              - {get_param: block_storage_hosts}
+            - list_join:
+              - "\n"
+              - {get_param: object_storage_hosts}
+            - list_join:
+              - "\n"
+              - {get_param: ceph_storage_hosts}
+        rabbit:
+          nodes:
+            list_join:
+            - ','
+            - {get_param: controller_names}
+        sysctl:
+          net.ipv4.tcp_keepalive_time: 5
+          net.ipv4.tcp_keepalive_probes: 5
+          net.ipv4.tcp_keepalive_intvl: 1
+
+outputs:
+  config_id:
+    description: The ID of the allNodesConfigImpl resource.
+    value:
+      {get_resource: allNodesConfigImpl}
index ab6be35..5669948 100644 (file)
@@ -8,6 +8,7 @@ resource_registry:
   OS::TripleO::CephStorage: puppet/ceph-storage-puppet.yaml
   OS::TripleO::ControllerPostDeployment: puppet/controller-post-puppet.yaml
   OS::TripleO::SwiftDevicesAndProxy::SoftwareConfig: puppet/swift-devices-and-proxy-config.yaml
+  OS::TripleO::AllNodes::SoftwareConfig: puppet/all-nodes-config.yaml
 
 # NOTE(dprince): requires a new release of python-heatclient
 #default_parameters:
index 6f85efe..f7b28b1 100644 (file)
@@ -8,3 +8,4 @@ resource_registry:
   OS::TripleO::CephStorage: ceph-storage.yaml
   OS::TripleO::ControllerPostDeployment: controller-post.yaml
   OS::TripleO::SwiftDevicesAndProxy::SoftwareConfig: swift-devices-and-proxy-config.yaml
+  OS::TripleO::AllNodes::SoftwareConfig: all-nodes-config.yaml
index 6216f6e..42e2e0d 100644 (file)
@@ -669,37 +669,14 @@ resources:
           CephMonitors: {get_attr: [Controller, corosync_node]}
 
   allNodesConfig:
-    type: OS::Heat::StructuredConfig
+    type: OS::TripleO::AllNodes::SoftwareConfig
     properties:
-      config:
-        completion-signal: {get_input: deploy_signal_id}
-        hosts:
-          list_join:
-          - "\n"
-          - - list_join:
-              - "\n"
-              - {get_attr: [Compute, hosts_entry]}
-            - list_join:
-              - "\n"
-              - {get_attr: [Controller, hosts_entry]}
-            - list_join:
-              - "\n"
-              - {get_attr: [BlockStorage, hosts_entry]}
-            - list_join:
-              - "\n"
-              - {get_attr: [ObjectStorage, hosts_entry]}
-            - list_join:
-              - "\n"
-              - {get_attr: [CephStorage, hosts_entry]}
-        rabbit:
-          nodes:
-            list_join:
-            - ','
-            - {get_attr: [Controller, hostname]}
-        sysctl:
-          net.ipv4.tcp_keepalive_time: 5
-          net.ipv4.tcp_keepalive_probes: 5
-          net.ipv4.tcp_keepalive_intvl: 1
+      compute_hosts: {get_attr: [Compute, hosts_entry]}
+      controller_hosts: {get_attr: [Controller, hosts_entry]}
+      block_storage_hosts: {get_attr: [BlockStorage, hosts_entry]}
+      object_storage_hosts: {get_attr: [ObjectStorage, hosts_entry]}
+      ceph_storage_hosts: {get_attr: [CephStorage, hosts_entry]}
+      controller_names: {get_attr: [Controller, hostname]}
 
   MysqlRootPassword:
     type: OS::Heat::RandomString
@@ -794,13 +771,13 @@ resources:
   ControllerAllNodesDeployment:
     type: OS::Heat::StructuredDeployments
     properties:
-      config: {get_resource: allNodesConfig}
+      config: {get_attr: [allNodesConfig, config_id]}
       servers: {get_attr: [Controller, attributes, nova_server_resource]}
 
   ComputeAllNodesDeployment:
     type: OS::Heat::StructuredDeployments
     properties:
-      config: {get_resource: allNodesConfig}
+      config: {get_attr: [allNodesConfig, config_id]}
       servers: {get_attr: [Compute, attributes, nova_server_resource]}
 
   # Nested stack deployment runs after all other controller deployments
diff --git a/puppet/all-nodes-config.yaml b/puppet/all-nodes-config.yaml
new file mode 100644 (file)
index 0000000..c5193e7
--- /dev/null
@@ -0,0 +1,60 @@
+heat_template_version: 2014-10-16
+description: 'All Nodes Config for Puppet'
+
+parameters:
+  compute_hosts:
+    type: comma_delimited_list
+  controller_hosts:
+    type: comma_delimited_list
+  block_storage_hosts:
+    type: comma_delimited_list
+  object_storage_hosts:
+    type: comma_delimited_list
+  ceph_storage_hosts:
+    type: comma_delimited_list
+  controller_names:
+    type: comma_delimited_list
+
+resources:
+
+  allNodesConfigImpl:
+    type: OS::Heat::StructuredConfig
+    properties:
+      config:
+        completion-signal: {get_input: deploy_signal_id}
+        hosts:
+          list_join:
+          - "\n"
+          - - list_join:
+              - "\n"
+              - {get_param: compute_hosts}
+            - list_join:
+              - "\n"
+              - {get_param: controller_hosts}
+            - list_join:
+              - "\n"
+              - {get_param: block_storage_hosts}
+            - list_join:
+              - "\n"
+              - {get_param: object_storage_hosts}
+            - list_join:
+              - "\n"
+              - {get_param: ceph_storage_hosts}
+        sysctl:
+          net.ipv4.tcp_keepalive_time: 5
+          net.ipv4.tcp_keepalive_probes: 5
+          net.ipv4.tcp_keepalive_intvl: 1
+        hiera:
+          datafiles:
+            rabbit:
+              mapped_data:
+                rabbit_nodes:
+                  list_join:
+                  - ','
+                  - {get_param: controller_names}
+
+outputs:
+  config_id:
+    description: The ID of the allNodesConfigImpl resource.
+    value:
+      {get_resource: allNodesConfigImpl}
index 845b6b6..a4d68ff 100644 (file)
@@ -555,6 +555,7 @@ resources:
             - controller
             - object
             - swift_devices_and_proxy # provided by SwiftDevicesAndProxyConfig
+            - rabbit # provided by allNodesConfig
             - common
           datafiles:
             common: