Containarise Barbican API
[apex-tripleo-heat-templates.git] / docker / services / congress.yaml
index 5b5a219..08170ce 100644 (file)
@@ -4,23 +4,21 @@ description: >
   OpenStack containerized Congress API service
 
 parameters:
-  DockerNamespace:
-    description: namespace
-    default: 'tripleoupstream'
-    type: string
   DockerCongressApiImage:
     description: image
-    default: 'centos-binary-congress-api:latest'
     type: string
   DockerCongressConfigImage:
     description: The container image to use for the congress config_volume
-    default: 'centos-binary-congress-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
@@ -44,10 +42,14 @@ resources:
   ContainersCommon:
     type: ./containers-common.yaml
 
+  MySQLClient:
+    type: ../../puppet/services/database/mysql-client.yaml
+
   CongressBase:
     type: ../../puppet/services/congress.yaml
     properties:
       EndpointMap: {get_param: EndpointMap}
+      ServiceData: {get_param: ServiceData}
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
       RoleName: {get_param: RoleName}
@@ -62,20 +64,25 @@ outputs:
         map_merge:
           - get_attr: [CongressBase, role_data, config_settings]
       step_config: &step_config
-        get_attr: [CongressBase, role_data, step_config]
+        list_join:
+          - "\n"
+          - - {get_attr: [CongressBase, role_data, step_config]}
+            - {get_attr: [MySQLClient, role_data, step_config]}
       service_config_settings: {get_attr: [CongressBase, role_data, service_config_settings]}
       # BEGIN DOCKER SETTINGS
       puppet_config:
         config_volume: congress
         puppet_tags: congress_config
         step_config: *step_config
-        config_image:
-          list_join:
-            - '/'
-            - [ {get_param: DockerNamespace}, {get_param: DockerCongressConfigImage} ]
+        config_image: {get_param: DockerCongressConfigImage}
       kolla_config:
         /var/lib/kolla/config_files/congress_api.json:
           command: /usr/bin/congress-server --config-file=/etc/congress/congress.conf --log-file=/var/log/congress/api.log
+          config_files:
+            - source: "/var/lib/kolla/config_files/src/*"
+              dest: "/"
+              merge: true
+              preserve_properties: true
           permissions:
             - path: /var/log/congress
               owner: congress:congress
@@ -84,10 +91,7 @@ outputs:
         # db sync runs before permissions set by kolla_config
         step_2:
           congress_init_logs:
-            image: &congress_api_image
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerCongressApiImage} ]
+            image: &congress_api_image {get_param: DockerCongressApiImage}
             privileged: false
             user: root
             volumes:
@@ -104,7 +108,10 @@ outputs:
               list_concat:
                 - {get_attr: [ContainersCommon, volumes]}
                 -
-                  - /var/lib/config-data/congress/etc/:/etc/:ro
+                  # FIXME(mandre) mounting /etc rw to workaround LP1696283
+                  # This should go away anyway and mount the exact files it
+                  # needs or use kolla set_configs.py
+                  - /var/lib/config-data/congress/etc/:/etc/
                   - /var/log/containers/congress:/var/log/congress
             command: "/usr/bin/bootstrap_host_exec congress su congress -s /bin/bash -c 'congress-db-manage --config-file /etc/congress/congress.conf upgrade head'"
         step_4:
@@ -119,7 +126,7 @@ outputs:
                 - {get_attr: [ContainersCommon, volumes]}
                 -
                   - /var/lib/kolla/config_files/congress_api.json:/var/lib/kolla/config_files/config.json:ro
-                  - /var/lib/config-data/congress/etc/congress/:/etc/congress/:ro
+                  - /var/lib/config-data/puppet-generated/congress/:/var/lib/kolla/config_files/src:ro
                   - /var/log/containers/congress:/var/log/congress
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS