Merge "Fix wrong permission on database during mysql_init tasks." into stable/pike
[apex-tripleo-heat-templates.git] / docker / services / swift-storage.yaml
index a07c92a..2d7aff6 100644 (file)
@@ -4,25 +4,17 @@ description: >
   OpenStack containerized Swift Storage services.
 
 parameters:
-  DockerNamespace:
-    description: namespace
-    default: 'tripleoupstream'
-    type: string
   DockerSwiftProxyImage:
     description: image
-    default: 'centos-binary-swift-proxy-server:latest'
     type: string
   DockerSwiftAccountImage:
     description: image
-    default: 'centos-binary-swift-account:latest'
     type: string
   DockerSwiftContainerImage:
     description: image
-    default: 'centos-binary-swift-container:latest'
     type: string
   DockerSwiftObjectImage:
     description: image
-    default: 'centos-binary-swift-object:latest'
     type: string
   DockerSwiftConfigImage:
     description: The container image to use for the swift config_volume
@@ -44,6 +36,10 @@ parameters:
     default: {}
     description: Parameters specific to the role
     type: json
+  ServiceData:
+    default: {}
+    description: Dictionary packing service data
+    type: json
   ServiceNetMap:
     default: {}
     description: Mapping of service_name -> network name. Typically set
@@ -54,7 +50,10 @@ parameters:
     default: {}
     description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})'
     type: json
-
+  UpgradeRemoveUnusedPackages:
+    default: false
+    description: Remove package if the service is being disabled during upgrade
+    type: boolean
 
 resources:
 
@@ -65,6 +64,7 @@ resources:
     type: ../../puppet/services/swift-storage.yaml
     properties:
       EndpointMap: {get_param: EndpointMap}
+      ServiceData: {get_param: ServiceData}
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
       RoleName: {get_param: RoleName}
@@ -80,18 +80,20 @@ outputs:
           - {get_attr: [SwiftStorageBase, role_data, config_settings]}
           # FIXME (cschwede): re-enable this once checks works inside containers
           - swift::storage::all::mount_check: false
+      logging_source: {get_attr: [SwiftStorageBase, role_data, logging_source]}
+      logging_groups: {get_attr: [SwiftStorageBase, role_data, logging_groups]}
       step_config: &step_config
-        get_attr: [SwiftStorageBase, role_data, step_config]
+        list_join:
+          - "\n"
+          - - {get_attr: [SwiftStorageBase, role_data, step_config]}
+            - "class xinetd() {}"
       service_config_settings: {get_attr: [SwiftStorageBase, role_data, service_config_settings]}
       # BEGIN DOCKER SETTINGS
       puppet_config:
         config_volume: swift
         puppet_tags: swift_config,swift_container_config,swift_container_sync_realms_config,swift_account_config,swift_object_config,swift_object_expirer_config,rsync::server
         step_config: *step_config
-        config_image:
-          list_join:
-            - '/'
-            - [ {get_param: DockerNamespace}, {get_param: DockerSwiftConfigImage} ]
+        config_image: {get_param: DockerSwiftConfigImage}
       kolla_config:
         /var/lib/kolla/config_files/swift_account_auditor.json:
           command: /usr/bin/swift-account-auditor /etc/swift/account-server.conf
@@ -201,10 +203,7 @@ outputs:
           # volume during the configuration stage.  We just need to create this
           # directory and make sure it's owned by swift.
           swift_setup_srv:
-            image: &swift_account_image
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerSwiftAccountImage} ]
+            image: &swift_account_image {get_param: DockerSwiftAccountImage}
             user: root
             command: ['chown', '-R', 'swift:', '/srv/node']
             volumes:
@@ -276,10 +275,7 @@ outputs:
                   - /var/log/containers/swift:/var/log/swift
             environment: *kolla_env
           swift_container_auditor:
-            image: &swift_container_image
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerSwiftContainerImage} ]
+            image: &swift_container_image {get_param: DockerSwiftContainerImage}
             net: host
             user: swift
             restart: always
@@ -343,10 +339,7 @@ outputs:
                   - /var/log/containers/swift:/var/log/swift
             environment: *kolla_env
           swift_object_auditor:
-            image: &swift_object_image
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerSwiftObjectImage} ]
+            image: &swift_object_image {get_param: DockerSwiftObjectImage}
             net: host
             user: swift
             restart: always
@@ -362,10 +355,7 @@ outputs:
                   - /var/log/containers/swift:/var/log/swift
             environment: *kolla_env
           swift_object_expirer:
-            image: &swift_proxy_image
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerSwiftProxyImage} ]
+            image: &swift_proxy_image {get_param: DockerSwiftProxyImage}
             net: host
             user: swift
             restart: always
@@ -480,6 +470,16 @@ outputs:
             - openstack-swift-container-updater
             - openstack-swift-container
             - openstack-swift-object-auditor
+            - openstack-swift-object-expirer
             - openstack-swift-object-replicator
             - openstack-swift-object-updater
             - openstack-swift-object
+        - name: Remove openstack-swift-container,object,account packages if operator requests it
+          yum: name={{ item }} state=removed
+          tags: step2
+          ignore_errors: True
+          when: {get_param: UpgradeRemoveUnusedPackages}
+          with_items:
+            - openstack-swift-container
+            - openstack-swift-object
+            - openstack-swift-account