Manually set healthchecks for _cron services
[apex-tripleo-heat-templates.git] / docker / services / keystone.yaml
index 7ecfc32..97b4c5d 100644 (file)
@@ -55,6 +55,9 @@ resources:
   ContainersCommon:
     type: ./containers-common.yaml
 
+  MySQLClient:
+    type: ../../puppet/services/database/mysql-client.yaml
+
   KeystoneBase:
     type: ../../puppet/services/keystone.yaml
     properties:
@@ -83,6 +86,7 @@ outputs:
           - "\n"
           - - "['Keystone_user', 'Keystone_endpoint', 'Keystone_domain', 'Keystone_tenant', 'Keystone_user_role', 'Keystone_role', 'Keystone_service'].each |String $val| { noop_resource($val) }"
             - {get_attr: [KeystoneBase, role_data, step_config]}
+            - {get_attr: [MySQLClient, role_data, step_config]}
       service_config_settings: {get_attr: [KeystoneBase, role_data, service_config_settings]}
       # BEGIN DOCKER SETTINGS
       puppet_config:
@@ -99,7 +103,9 @@ outputs:
               merge: true
               preserve_properties: true
         /var/lib/kolla/config_files/keystone_cron.json:
-          command: /usr/sbin/cron -n
+          # FIXME(dprince): this is unused ATM because Kolla hardcodes the
+          # args for the keystone container to -DFOREGROUND
+          command: /usr/sbin/crond -n
           config_files:
             - source: "/var/lib/kolla/config_files/src/*"
               dest: "/"
@@ -164,9 +170,13 @@ outputs:
           keystone_cron:
             start_order: 4
             image: *keystone_image
+            user: root
             net: host
             privileged: false
             restart: always
+            command: ['/bin/bash', '-c', '/usr/local/bin/kolla_set_configs && /usr/sbin/crond -n']
+            healthcheck:
+              test: /bin/true
             volumes:
               list_concat:
                 - {get_attr: [ContainersCommon, volumes]}
@@ -192,5 +202,9 @@ outputs:
         - name: Stop and disable keystone service (running under httpd)
           tags: step2
           service: name=httpd state=stopped enabled=no
+        - name: remove old keystone cron jobs
+          file:
+            path: /var/spool/cron/keystone
+            state: absent
       metadata_settings:
         get_attr: [KeystoneBase, role_data, metadata_settings]