Split out SwiftDevicesAndProxy SoftwareConfig
authorDan Prince <dprince@redhat.com>
Fri, 13 Feb 2015 02:09:02 +0000 (21:09 -0500)
committerDan Prince <dprince@redhat.com>
Fri, 13 Feb 2015 03:19:24 +0000 (22:19 -0500)
This patch splits out the SwiftDevicesAndProxy 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 swift devices.

Partial-bug: 1418805

Change-Id: Ibf6038460f36279ad51a04947589d4a03a553f66

overcloud-resource-registry-puppet.yaml
overcloud-resource-registry.yaml
overcloud-without-mergepy.yaml
puppet/controller-puppet.yaml
puppet/swift-devices-and-proxy-config.yaml [new file with mode: 0644]
swift-devices-and-proxy-config.yaml [new file with mode: 0644]

index 0e6f623..ab6be35 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::SwiftDevicesAndProxy::SoftwareConfig: puppet/swift-devices-and-proxy-config.yaml
 
 # NOTE(dprince): requires a new release of python-heatclient
 #default_parameters:
index ebc2b8b..6f85efe 100644 (file)
@@ -7,3 +7,4 @@ resource_registry:
   OS::TripleO::Net::SoftwareConfig: net-config-noop.yaml
   OS::TripleO::CephStorage: ceph-storage.yaml
   OS::TripleO::ControllerPostDeployment: controller-post.yaml
+  OS::TripleO::SwiftDevicesAndProxy::SoftwareConfig: swift-devices-and-proxy-config.yaml
index 6fde167..6216f6e 100644 (file)
@@ -751,36 +751,23 @@ resources:
   ControllerSwiftDeployment:
     type: OS::Heat::StructuredDeployments
     properties:
-      config: {get_resource: SwiftDevicesAndProxyConfig}
+      config: {get_attr: [SwiftDevicesAndProxyConfig, config_id]}
       servers: {get_attr: [Controller, attributes, nova_server_resource]}
       signal_transport: NO_SIGNAL
 
   ObjectStorageSwiftDeployment:
     type: OS::Heat::StructuredDeployments
     properties:
-      config: {get_resource: SwiftDevicesAndProxyConfig}
+      config: {get_attr: [SwiftDevicesAndProxyConfig, config_id]}
       servers: {get_attr: [ObjectStorage, attributes, nova_server_resource]}
       signal_transport: NO_SIGNAL
 
   SwiftDevicesAndProxyConfig:
-    type: OS::Heat::StructuredConfig
+    type: OS::TripleO::SwiftDevicesAndProxy::SoftwareConfig
     properties:
-      group: os-apply-config
-      config:
-        swift:
-          devices:
-            list_join:
-            - ", "
-            - - list_join:
-                - ", "
-                - {get_attr: [Controller, swift_device]}
-              - list_join:
-                - ", "
-                - {get_attr: [ObjectStorage, swift_device]}
-          proxy-memcache:
-            list_join:
-            - ","
-            - {get_attr: [Controller, swift_proxy_memcache]}
+      controller_swift_devices: {get_attr: [Controller, swift_device]}
+      object_store_swift_devices: {get_attr: [ObjectStorage, swift_device]}
+      controller_swift_proxy_memcaches: {get_attr: [Controller, swift_proxy_memcache]}
 
   ControllerClusterConfig:
     type: OS::Heat::StructuredConfig
index 537b1cf..845b6b6 100644 (file)
@@ -554,6 +554,7 @@ resources:
             - heat_config_%{::deploy_config_name}
             - controller
             - object
+            - swift_devices_and_proxy # provided by SwiftDevicesAndProxyConfig
             - common
           datafiles:
             common:
@@ -564,8 +565,6 @@ resources:
               raw_data: {get_file: hieradata/controller.yaml}
               oac_data: # data we map in from other OAC configurations
                 bootstrap_nodeid: bootstrap_host.bootstrap_nodeid
-                # Swift
-                tripleo::ringbuilder::devices: swift.devices
               mapped_data: # data supplied directly to this deployment configuration, etc
                 debug: {get_input: debug}
                 bootstack_nodeid: {get_input: bootstack_nodeid}
diff --git a/puppet/swift-devices-and-proxy-config.yaml b/puppet/swift-devices-and-proxy-config.yaml
new file mode 100644 (file)
index 0000000..1cb897e
--- /dev/null
@@ -0,0 +1,38 @@
+heat_template_version: 2014-10-16
+description: 'Swift Devices and Proxy Config for Puppet'
+
+parameters:
+  controller_swift_devices:
+    type: comma_delimited_list
+  object_store_swift_devices:
+    type: comma_delimited_list
+  # TODO: add support for puppet swift proxy memcache configuration
+  controller_swift_proxy_memcaches:
+    type: comma_delimited_list
+
+resources:
+
+  SwiftDevicesAndProxyConfigImpl:
+    type: OS::Heat::StructuredConfig
+    properties:
+      group: os-apply-config
+      config:
+        hiera:
+          datafiles:
+            swift_devices_and_proxy:
+              mapped_data:
+                tripleo::ringbuilder::devices:
+                  list_join:
+                  - ", "
+                  - - list_join:
+                      - ", "
+                      - {get_param: controller_swift_devices}
+                    - list_join:
+                      - ", "
+                      - {get_param: object_store_swift_devices}
+
+outputs:
+  config_id:
+    description: The ID of the SwiftDevicesAndProxyConfigImpl resource.
+    value:
+      {get_resource: SwiftDevicesAndProxyConfigImpl}
diff --git a/swift-devices-and-proxy-config.yaml b/swift-devices-and-proxy-config.yaml
new file mode 100644 (file)
index 0000000..d422a3e
--- /dev/null
@@ -0,0 +1,38 @@
+heat_template_version: 2014-10-16
+description: 'Swift Devices and Proxy Config'
+
+parameters:
+  controller_swift_devices:
+    type: comma_delimited_list
+  object_store_swift_devices:
+    type: comma_delimited_list
+  controller_swift_proxy_memcaches:
+    type: comma_delimited_list
+
+resources:
+
+  SwiftDevicesAndProxyConfigImpl:
+    type: OS::Heat::StructuredConfig
+    properties:
+      group: os-apply-config
+      config:
+        swift:
+          devices:
+            list_join:
+            - ", "
+            - - list_join:
+                - ", "
+                - {get_param: controller_swift_devices}
+              - list_join:
+                - ", "
+                - {get_param: object_store_swift_devices}
+          proxy-memcache:
+            list_join:
+            - ","
+            - {get_param: controller_swift_proxy_memcaches}
+
+outputs:
+  config_id:
+    description: The ID of the SwiftDevicesAndProxyConfigImpl resource.
+    value:
+      {get_resource: SwiftDevicesAndProxyConfigImpl}