Merge "TLS everywhere/docker: add nova services to environment"
[apex-tripleo-heat-templates.git] / docker / services / ec2-api.yaml
index 0c65a90..1d4ddd3 100644 (file)
@@ -4,23 +4,21 @@ description: >
   OpenStack containerized EC2 API service
 
 parameters:
-  DockerNamespace:
-    description: namespace
-    default: 'tripleoupstream'
-    type: string
   DockerEc2ApiImage:
     description: image
-    default: 'centos-binary-ec2-api:latest'
     type: string
   DockerEc2ApiConfigImage:
-    description: The container image to use for the ec2api config_volume
-    default: 'centos-binary-ec2-api:latest'
+    description: The container image to use for the ec2_api config_volume
     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,6 +42,9 @@ resources:
   ContainersCommon:
     type: ./containers-common.yaml
 
+  MySQLClient:
+    type: ../../puppet/services/database/mysql-client.yaml
+
   Ec2ApiPuppetBase:
       type: ../../puppet/services/ec2-api.yaml
       properties:
@@ -60,26 +61,36 @@ outputs:
       service_name: {get_attr: [Ec2ApiPuppetBase, role_data, service_name]}
       config_settings: {get_attr: [Ec2ApiPuppetBase, role_data, config_settings]}
       step_config: &step_config
-        get_attr: [Ec2ApiPuppetBase, role_data, step_config]
+        list_join:
+          - "\n"
+          - - {get_attr: [Ec2ApiPuppetBase, role_data, step_config]}
+            - {get_attr: [MySQLClient, role_data, step_config]}
       service_config_settings: {get_attr: [Ec2ApiPuppetBase, role_data, service_config_settings]}
       # BEGIN DOCKER SETTINGS
       puppet_config:
-        config_volume: ec2api
+        config_volume: ec2_api
         puppet_tags: ec2api_api_paste_ini,ec2api_config
         step_config: *step_config
-        config_image:
-          list_join:
-            - '/'
-            - [ {get_param: DockerNamespace}, {get_param: DockerEc2ApiConfigImage} ]
+        config_image: {get_param: DockerEc2ApiConfigImage}
       kolla_config:
         /var/lib/kolla/config_files/ec2_api.json:
           command: /usr/bin/ec2-api
+          config_files:
+            - source: "/var/lib/kolla/config_files/src/*"
+              dest: "/"
+              merge: true
+              preserve_properties: true
           permissions:
             - path: /var/log/ec2api
               owner: ec2api:ec2api
               recurse: true
         /var/lib/kolla/config_files/ec2_api_metadata.json:
           command: /usr/bin/ec2-api-metadata
+          config_files:
+            - source: "/var/lib/kolla/config_files/src/*"
+              dest: "/"
+              merge: true
+              preserve_properties: true
           permissions:
             - path: /var/log/ec2api # default log dir for metadata service as well
               owner: ec2api:ec2api
@@ -88,10 +99,7 @@ outputs:
         # db sync runs before permissions set by kolla_config
         step_2:
           ec2_api_init_logs:
-            image: &ec2_api_image
-              list_join:
-                - '/'
-                - [ {get_param: DockerNamespace}, {get_param: DockerEc2ApiImage} ]
+            image: &ec2_api_image {get_param: DockerEc2ApiImage}
             privileged: false
             user: root
             volumes:
@@ -125,7 +133,7 @@ outputs:
                 - {get_attr: [ContainersCommon, volumes]}
                 -
                   - /var/lib/kolla/config_files/ec2_api.json:/var/lib/kolla/config_files/config.json:ro
-                  - /var/lib/config-data/ec2_api/etc/ec2api/:/etc/ec2api/:ro
+                  - /var/lib/config-data/puppet-generated/ec2_api/:/var/lib/kolla/config_files/src:ro
                   - /var/log/containers/ec2_api:/var/log/ec2api
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
@@ -139,7 +147,7 @@ outputs:
                 - {get_attr: [ContainersCommon, volumes]}
                 -
                   - /var/lib/kolla/config_files/ec2_api_metadata.json:/var/lib/kolla/config_files/config.json:ro
-                  - /var/lib/config-data/ec2_api/etc/ec2api/:/etc/ec2api/:ro
+                  - /var/lib/config-data/puppet-generated/ec2_api/:/var/lib/kolla/config_files/src:ro
                   - /var/log/containers/ec2_api_metadata:/var/log/ec2api
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS