1 heat_template_version: ocata
4 MySQL service deployment using puppet
9 default: 'tripleoupstream'
13 default: 'centos-binary-mariadb:latest'
17 description: Mapping of service endpoint -> protocol. Typically set
18 via parameter_defaults in the resource registry.
22 description: Mapping of service_name -> network name. Typically set
23 via parameter_defaults in the resource registry. This
24 mapping overrides those in ServiceNetMapDefaults.
37 type: ../../../puppet/services/database/mysql.yaml
39 EndpointMap: {get_param: EndpointMap}
40 ServiceNetMap: {get_param: ServiceNetMap}
41 DefaultPasswords: {get_param: DefaultPasswords}
45 description: Containerized service MySQL using composable services.
47 service_name: {get_attr: [MysqlPuppetBase, role_data, service_name]}
50 - {get_attr: [MysqlPuppetBase, role_data, config_settings]}
51 # Set PID file to what kolla mariadb bootstrap script expects
52 - tripleo::profile::base::database::mysql::mysql_server_options:
54 pid-file: /var/lib/mysql/mariadb.pid
56 pid-file: /var/lib/mysql/mariadb.pid
60 - - "['Mysql_datadir', 'Mysql_user', 'Mysql_database', 'Mysql_grant', 'Mysql_plugin'].each |String $val| { noop_resource($val) }"
61 - {get_attr: [MysqlPuppetBase, role_data, step_config]}
62 upgrade_tasks: {get_attr: [MysqlPuppetBase, role_data, upgrade_tasks]}
63 # BEGIN DOCKER SETTINGS #
64 docker_image: &mysql_image
67 - [ {get_param: DockerNamespace}, {get_param: DockerMysqlImage} ]
68 puppet_tags: file # set this even though file is the default
70 config_image: *mysql_image
72 /var/lib/kolla/config_files/mysql.json:
73 command: /usr/bin/mysqld_safe
75 - dest: /etc/mysql/my.cnf
76 source: /var/lib/kolla/config_files/src/etc/my.cnf
79 - dest: /etc/my.cnf.d/galera.cnf
80 source: /var/lib/kolla/config_files/src/etc/my.cnf.d/galera.cnf
90 volumes: &mysql_volumes
91 - /var/lib/kolla/config_files/mysql.json:/var/lib/kolla/config_files/config.json
92 - /var/lib/config-data/mysql/:/var/lib/kolla/config_files/src:ro
93 - /etc/localtime:/etc/localtime:ro
94 - /etc/hosts:/etc/hosts:ro
95 - mariadb:/var/lib/mysql/
97 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
98 - KOLLA_BOOTSTRAP=True
99 # NOTE(mandre) skip wsrep cluster status check
100 - KOLLA_KUBERNETES=True
104 - - 'DB_ROOT_PASSWORD'
107 expression: $.data.passwords.where($ != '').first()
110 - {get_param: MysqlRootPassword}
111 - {get_param: [DefaultPasswords, mysql_root_password]}
117 volumes: *mysql_volumes
119 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
121 # MySQL database initialization occurs only on single node
124 - 'mysql_database,mysql_grant,mysql_user'
125 - 'include ::tripleo::profile::base::database::mysql'
128 - [ {get_param: DockerNamespace}, {get_param: DockerMysqlImage} ]
129 - - "mariadb:/var/lib/mysql/:ro"
130 - "/var/lib/config-data/mysql/root:/root:ro" #provides .my.cnf