nova_api_cron docker fix: add /var/spool/cron/nova
authorDan Prince <dprince@redhat.com>
Thu, 20 Jul 2017 23:45:15 +0000 (19:45 -0400)
committerDan Prince <dprince@redhat.com>
Thu, 20 Jul 2017 23:45:15 +0000 (19:45 -0400)
This patch reworks the nova_api_cron container so that it contains
the /var/spool/cron cron for the nova user and also so that it
contains the correct nova.conf file.

This should allow kolla-start to copy the correct config files
into place and then start the cron service to run the nova
tasks periodically.

Change-Id: Ib6b2ca5af5419130fb9c83f83d6f4bf97410e870
Related-bug: #1701254

docker/services/nova-api.yaml

index 1d73a53..4bec803 100644 (file)
@@ -88,6 +88,17 @@ outputs:
             - path: /var/log/nova
               owner: nova:nova
               recurse: true
+        /var/lib/kolla/config_files/nova_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/nova
+              owner: nova:nova
+              recurse: true
       docker_config:
         # db sync runs before permissions set by kolla_config
         step_2:
@@ -151,7 +162,7 @@ outputs:
             user: nova
             privileged: true
             restart: always
-            volumes: &nova_api_volumes
+            volumes:
               list_concat:
                 - {get_attr: [ContainersCommon, volumes]}
                 -
@@ -164,12 +175,17 @@ outputs:
             image: *nova_api_image
             net: host
             user: root
-            privileged: true
+            privileged: false
             restart: always
-            volumes: *nova_api_volumes
+            volumes:
+              list_concat:
+                - {get_attr: [ContainersCommon, volumes]}
+                -
+                  - /var/lib/kolla/config_files/nova_api_cron.json:/var/lib/kolla/config_files/config.json:ro
+                  - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
+                  - /var/log/containers/nova:/var/log/nova
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
-            command: "/usr/sbin/crond -n"
         step_5:
           nova_api_discover_hosts:
             start_order: 1