Merge "Run gnocchi upgrade with sacks in docker template"
[apex-tripleo-heat-templates.git] / docker / services / cinder-api.yaml
index 07315e7..900131c 100644 (file)
@@ -4,23 +4,21 @@ description: >
   OpenStack containerized Cinder API service
 
 parameters:
-  DockerNamespace:
-    description: namespace
-    default: 'tripleoupstream'
-    type: string
   DockerCinderApiImage:
     description: image
-    default: 'centos-binary-cinder-api:latest'
     type: string
   DockerCinderConfigImage:
     description: The container image to use for the cinder config_volume
-    default: 'centos-binary-cinder-api:latest'
     type: string
   EndpointMap:
     default: {}
     description: Mapping of service endpoint -> protocol. Typically set
                  via parameter_defaults in the resource registry.
     type: json
+  ServiceData:
+    default: {}
+    description: Dictionary packing service data
+    type: json
   ServiceNetMap:
     default: {}
     description: Mapping of service_name -> network name. Typically set
@@ -51,10 +49,14 @@ resources:
   ContainersCommon:
     type: ./containers-common.yaml
 
+  MySQLClient:
+    type: ../../puppet/services/database/mysql-client.yaml
+
   CinderBase:
     type: ../../puppet/services/cinder-api.yaml
     properties:
       EndpointMap: {get_param: EndpointMap}
+      ServiceData: {get_param: ServiceData}
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
       RoleName: {get_param: RoleName}
@@ -67,17 +69,17 @@ outputs:
       service_name: {get_attr: [CinderBase, role_data, service_name]}
       config_settings: {get_attr: [CinderBase, role_data, config_settings]}
       step_config: &step_config
-        get_attr: [CinderBase, role_data, step_config]
+        list_join:
+          - "\n"
+          - - {get_attr: [CinderBase, role_data, step_config]}
+            - {get_attr: [MySQLClient, role_data, step_config]}
       service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
       # BEGIN DOCKER SETTINGS
       puppet_config:
         config_volume: cinder
         puppet_tags: cinder_config,file,concat,file_line
         step_config: *step_config
-        config_image:
-          list_join:
-            - '/'
-            - [ {get_param: DockerNamespace}, {get_param: DockerCinderConfigImage} ]
+        config_image: {get_param: DockerCinderConfigImage}
       kolla_config:
         /var/lib/kolla/config_files/cinder_api.json:
           command: /usr/sbin/httpd -DFOREGROUND
@@ -90,13 +92,21 @@ outputs:
             - path: /var/log/cinder
               owner: cinder:cinder
               recurse: true
+        /var/lib/kolla/config_files/cinder_api_cron.json:
+          command: /usr/sbin/crond -n
+          config_files:
+            - source: "/var/lib/kolla/config_files/src/*"
+              dest: "/"
+              merge: true
+              preserve_properties: true
+          permissions:
+            - path: /var/log/cinder
+              owner: cinder:cinder
+              recurse: true
       docker_config:
         step_2:
           cinder_api_init_logs:
-            image: &cinder_api_image
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerCinderApiImage} ]
+            image: &cinder_api_image {get_param: DockerCinderApiImage}
             privileged: false
             user: root
             volumes:
@@ -147,6 +157,24 @@ outputs:
                       - ''
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
+          cinder_api_cron:
+            image: *cinder_api_image
+            net: host
+            user: root
+            privileged: false
+            restart: always
+            volumes:
+              list_concat:
+                - {get_attr: [ContainersCommon, volumes]}
+                -
+                  - /var/lib/kolla/config_files/cinder_api_cron.json:/var/lib/kolla/config_files/config.json:ro
+                  - /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro
+                  - /var/log/containers/cinder:/var/log/cinder
+            environment:
+              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
+
+      metadata_settings:
+        get_attr: [CinderBase, role_data, metadata_settings]
       host_prep_tasks:
         - name: create persistent logs directory
           file: