Merge "Write md5sum for service config directories"
[apex-tripleo-heat-templates.git] / docker / services / nova-compute.yaml
index 624596e..9f647eb 100644 (file)
@@ -21,6 +21,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
@@ -38,6 +46,8 @@ resources:
       EndpointMap: {get_param: EndpointMap}
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
+      RoleName: {get_param: RoleName}
+      RoleParameters: {get_param: RoleParameters}
 
 outputs:
   role_data:
@@ -64,22 +74,29 @@ outputs:
           - '/'
           - [ {get_param: DockerNamespace}, {get_param: DockerNovaComputeImage} ]
       kolla_config:
-        /var/lib/kolla/config_files/nova-compute.json:
+        /var/lib/kolla/config_files/nova_compute.json:
           command: /usr/bin/nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/rootwrap.conf
+          permissions:
+            - path: /var/log/nova
+              owner: nova:nova
+              recurse: true
+            - path: /var/lib/nova
+              owner: nova:nova
+              recurse: true
       docker_config:
         # FIXME: run discover hosts here
         step_4:
-          novacompute:
+          nova_compute:
             image: *nova_compute_image
             net: host
             privileged: true
-            user: root
+            user: nova
             restart: always
             volumes:
               list_concat:
                 - {get_attr: [ContainersCommon, volumes]}
                 -
-                  - /var/lib/kolla/config_files/nova-compute.json:/var/lib/kolla/config_files/config.json:ro
+                  - /var/lib/kolla/config_files/nova_compute.json:/var/lib/kolla/config_files/config.json:ro
                   - /var/lib/config-data/nova_libvirt/etc/nova/:/etc/nova/:ro
                   - /dev:/dev
                   - /etc/iscsi:/etc/iscsi
@@ -87,13 +104,18 @@ outputs:
                   - /run:/run
                   - /var/lib/nova:/var/lib/nova
                   - /var/lib/libvirt:/var/lib/libvirt
+                  - /var/log/containers/nova:/var/log/nova
             environment:
              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
       host_prep_tasks:
-        - name: create /var/lib/libvirt
+        - name: create persistent directories
           file:
-            path: /var/lib/libvirt
+            path: "{{ item }}"
             state: directory
+          with_items:
+            - /var/log/containers/nova
+            - /var/lib/nova
+            - /var/lib/libvirt
       upgrade_tasks:
         - name: Stop and disable nova-compute service
           tags: step2