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
57 step_config: &step_config
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 # BEGIN DOCKER SETTINGS #
63 docker_image: &mysql_image
66 - [ {get_param: DockerNamespace}, {get_param: DockerMysqlImage} ]
69 puppet_tags: file # set this even though file is the default
70 step_config: *step_config
71 config_image: *mysql_image
73 /var/lib/kolla/config_files/mysql.json:
74 command: /usr/bin/mysqld_safe
76 - dest: /etc/mysql/my.cnf
77 source: /var/lib/kolla/config_files/src/etc/my.cnf
80 - dest: /etc/my.cnf.d/galera.cnf
81 source: /var/lib/kolla/config_files/src/etc/my.cnf.d/galera.cnf
91 volumes: &mysql_volumes
92 - /var/lib/kolla/config_files/mysql.json:/var/lib/kolla/config_files/config.json
93 - /var/lib/config-data/mysql/:/var/lib/kolla/config_files/src:ro
94 - /etc/localtime:/etc/localtime:ro
95 - /etc/hosts:/etc/hosts:ro
96 - mariadb:/var/lib/mysql/
98 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
99 - KOLLA_BOOTSTRAP=True
100 # NOTE(mandre) skip wsrep cluster status check
101 - KOLLA_KUBERNETES=True
105 - - 'DB_ROOT_PASSWORD'
108 expression: $.data.passwords.where($ != '').first()
111 - {get_param: MysqlRootPassword}
112 - {get_param: [DefaultPasswords, mysql_root_password]}
118 volumes: *mysql_volumes
120 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
122 # MySQL database initialization occurs only on single node
124 config_volume: 'mysql_init_tasks'
125 puppet_tags: 'mysql_database,mysql_grant,mysql_user'
126 step_config: 'include ::tripleo::profile::base::database::mysql'
130 - [ {get_param: DockerNamespace}, {get_param: DockerMysqlImage} ]
132 - "mariadb:/var/lib/mysql/:ro"
133 - "/var/lib/config-data/mysql/root:/root:ro" #provides .my.cnf
135 - name: Stop and disable mysql service
137 service: name=mariadb state=stopped enabled=no