Merge "Start redis service after upgrade"
[apex-tripleo-heat-templates.git] / puppet / services / swift-ringbuilder.yaml
index f41228e..dd4cebb 100644 (file)
@@ -1,9 +1,13 @@
-heat_template_version: 2016-04-08
+heat_template_version: pike
 
 description: >
   OpenStack Swift Ringbuilder
 
 parameters:
+  ServiceData:
+    default: {}
+    description: Dictionary packing service data
+    type: json
   ServiceNetMap:
     default: {}
     description: Mapping of service_name -> network name. Typically set
@@ -13,6 +17,14 @@ parameters:
   DefaultPasswords:
     default: {}
     type: json
+  RoleName:
+    default: ''
+    description: Role name on which the service is applied
+    type: string
+  RoleParameters:
+    default: {}
+    description: Parameters specific to the role
+    type: json
   EndpointMap:
     default: {}
     description: Mapping of service endpoint -> protocol. Typically set
@@ -34,6 +46,32 @@ parameters:
     type: number
     default: 3
     description: How many replicas to use in the swift rings.
+  SwiftRawDisks:
+    default: {}
+    description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})'
+    type: json
+  SwiftUseLocalDir:
+    default: true
+    description: 'Use a local directory for Swift storage services when building rings'
+    type: boolean
+  SwiftRingGetTempurl:
+    default: ''
+    description: A temporary Swift URL to download rings from.
+    type: string
+  SwiftRingPutTempurl:
+    default: ''
+    description: A temporary Swift URL to upload rings to.
+    type: string
+
+conditions:
+  swift_use_local_dir:
+    and:
+    - equals:
+      - get_param: SwiftUseLocalDir
+      - true
+    - equals:
+      - get_param: SwiftRawDisks
+      - {}
 
 outputs:
   role_data:
@@ -41,9 +79,22 @@ outputs:
     value:
       service_name: swift_ringbuilder
       config_settings:
+        tripleo::profile::base::swift::ringbuilder::swift_ring_get_tempurl: {get_param: SwiftRingGetTempurl}
+        tripleo::profile::base::swift::ringbuilder::swift_ring_put_tempurl: {get_param: SwiftRingPutTempurl}
         tripleo::profile::base::swift::ringbuilder::build_ring: {get_param: SwiftRingBuild}
         tripleo::profile::base::swift::ringbuilder::replicas: {get_param: SwiftReplicas}
-        swift::ringbuilder::part_power: {get_param: SwiftPartPower}
-        swift::ringbuilder::min_part_hours: {get_param: SwiftMinPartHours}
+        tripleo::profile::base::swift::ringbuilder::part_power: {get_param: SwiftPartPower}
+        tripleo::profile::base::swift::ringbuilder::min_part_hours: {get_param: SwiftMinPartHours}
+        tripleo::profile::base::swift::ringbuilder::raw_disk_prefix: 'r1z1-'
+        tripleo::profile::base::swift::ringbuilder::raw_disks:
+          yaql:
+            expression: $.data.raw_disk_lists.flatten()
+            data:
+              raw_disk_lists:
+              - {if: [swift_use_local_dir, [':%PORT%/d1'], []]}
+              - repeat:
+                  template: ':%PORT%/DEVICE'
+                  for_each:
+                    DEVICE: {get_param: SwiftRawDisks}
       step_config: |
         include ::tripleo::profile::base::swift::ringbuilder