Add heat parameter for all of config_volume images
[apex-tripleo-heat-templates.git] / docker / services / database / mysql.yaml
index e065e20..725b2b4 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: ocata
+heat_template_version: pike
 
 description: >
   MySQL service deployment using puppet
@@ -12,6 +12,10 @@ parameters:
     description: image
     default: 'centos-binary-mariadb:latest'
     type: string
+  DockerMysqlConfigImage:
+    description: The container image to use for the mysql config_volume
+    default: 'centos-binary-mariadb:latest'
+    type: string
   EndpointMap:
     default: {}
     description: Mapping of service endpoint -> protocol. Typically set
@@ -26,6 +30,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
   MysqlRootPassword:
     type: string
     hidden: true
@@ -39,6 +51,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,10 +78,10 @@ outputs:
         config_volume: mysql
         puppet_tags: file # set this even though file is the default
         step_config: *step_config
-        config_image: &mysql_image
+        config_image: &mysql_config_image
           list_join:
             - '/'
-            - [ {get_param: DockerNamespace}, {get_param: DockerMysqlImage} ]
+            - [ {get_param: DockerNamespace}, {get_param: DockerMysqlConfigImage} ]
       kolla_config:
         /var/lib/kolla/config_files/mysql.json:
           command: /usr/bin/mysqld_safe
@@ -77,17 +91,19 @@ outputs:
               recurse: true
       docker_config:
         # Kolla_bootstrap runs before permissions set by kolla_config
-        step_2:
+        step_1:
           mysql_init_logs:
-            start_order: 0
-            image: *mysql_image
+            image: &mysql_image
+              list_join:
+                - '/'
+                - [ {get_param: DockerNamespace}, {get_param: DockerMysqlImage} ]
             privileged: false
             user: root
             volumes:
               - /var/log/containers/mysql:/var/log/mariadb
             command: ['/bin/bash', '-c', 'chown -R mysql:mysql /var/log/mariadb']
+        step_2:
           mysql_bootstrap:
-            start_order: 1
             detach: false
             image: *mysql_image
             net: host
@@ -95,7 +111,7 @@ outputs:
             command: ['bash', '-c', 'test -e /var/lib/mysql/mysql || kolla_start']
             volumes: &mysql_volumes
               - /var/lib/kolla/config_files/mysql.json:/var/lib/kolla/config_files/config.json
-              - /var/lib/config-data/mysql/etc/:/etc/:ro
+              - /var/lib/config-data/mysql/etc/my.cnf.d:/etc/my.cnf.d:ro
               - /etc/localtime:/etc/localtime:ro
               - /etc/hosts:/etc/hosts:ro
               - /var/lib/mysql:/var/lib/mysql
@@ -130,7 +146,7 @@ outputs:
           config_volume: 'mysql_init_tasks'
           puppet_tags: 'mysql_database,mysql_grant,mysql_user'
           step_config: 'include ::tripleo::profile::base::database::mysql'
-          config_image: *mysql_image
+          config_image: *mysql_config_image
           volumes:
             - /var/lib/mysql:/var/lib/mysql/:ro
             - /var/log/containers/mysql:/var/log/mariadb