Merge "Containers: Bind mount directories with the key/certs for heat"
[apex-tripleo-heat-templates.git] / docker / services / gnocchi-metricd.yaml
index 6b41eaa..b0faa51 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: ocata
+heat_template_version: pike
 
 description: >
   OpenStack containerized Gnocchi Metricd service
@@ -29,6 +29,9 @@ parameters:
 
 resources:
 
+  ContainersCommon:
+    type: ./containers-common.yaml
+
   GnocchiMetricdBase:
     type: ../../puppet/services/gnocchi-metricd.yaml
     properties:
@@ -57,6 +60,10 @@ outputs:
       kolla_config:
         /var/lib/kolla/config_files/gnocchi-metricd.json:
           command: /usr/bin/gnocchi-metricd
+          permissions:
+            - path: /var/log/gnocchi
+              owner: gnocchi:gnocchi
+              recurse: true
       docker_config:
         step_4:
           gnocchi_metricd:
@@ -65,9 +72,20 @@ outputs:
             privileged: false
             restart: always
             volumes:
-              - /var/lib/kolla/config_files/gnocchi-metricd.json:/var/lib/kolla/config_files/config.json:ro
-              - /var/lib/config-data/gnocchi/etc/gnocchi/:/etc/gnocchi/:ro
-              - /etc/hosts:/etc/hosts:ro
-              - /etc/localtime:/etc/localtime:ro
+              list_concat:
+                - {get_attr: [ContainersCommon, volumes]}
+                -
+                  - /var/lib/kolla/config_files/gnocchi-metricd.json:/var/lib/kolla/config_files/config.json:ro
+                  - /var/lib/config-data/gnocchi/etc/gnocchi/:/etc/gnocchi/:ro
+                  - /var/log/containers/gnocchi:/var/log/gnocchi
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
+      host_prep_tasks:
+        - name: create persistent logs directory
+          file:
+            path: /var/log/containers/gnocchi
+            state: directory
+      upgrade_tasks:
+        - name: Stop and disable openstack-gnocchi-metricd service
+          tags: step2
+          service: name=openstack-gnocchi-metricd.service state=stopped enabled=no