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 #
65 puppet_tags: file # set this even though file is the default
66 step_config: *step_config
67 config_image: &mysql_image
70 - [ {get_param: DockerNamespace}, {get_param: DockerMysqlImage} ]
72 /var/lib/kolla/config_files/mysql.json:
73 command: /usr/bin/mysqld_safe
82 # Kolla does only non-recursive chown
83 command: ['chown', '-R', 'mysql:', '/var/lib/mysql']
85 - /var/lib/mysql:/var/lib/mysql
91 # Kolla bootstraps aren't idempotent, explicitly checking if bootstrap was done
92 command: ['bash', '-c', 'test -e /var/lib/mysql/mysql || kolla_start']
93 volumes: &mysql_volumes
94 - /var/lib/kolla/config_files/mysql.json:/var/lib/kolla/config_files/config.json
95 - /var/lib/config-data/mysql/etc/:/etc/:ro
96 - /etc/localtime:/etc/localtime:ro
97 - /etc/hosts:/etc/hosts:ro
98 - /var/lib/mysql:/var/lib/mysql
100 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
101 - KOLLA_BOOTSTRAP=True
102 # NOTE(mandre) skip wsrep cluster status check
103 - KOLLA_KUBERNETES=True
107 - - 'DB_ROOT_PASSWORD'
110 expression: $.data.passwords.where($ != '').first()
113 - {get_param: MysqlRootPassword}
114 - {get_param: [DefaultPasswords, mysql_root_password]}
120 volumes: *mysql_volumes
122 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
124 # MySQL database initialization occurs only on single node
126 config_volume: 'mysql_init_tasks'
127 puppet_tags: 'mysql_database,mysql_grant,mysql_user'
128 step_config: 'include ::tripleo::profile::base::database::mysql'
129 config_image: *mysql_image
131 - /var/lib/mysql:/var/lib/mysql/:ro
132 - /var/lib/config-data/mysql/root:/root:ro #provides .my.cnf
134 - name: create /var/lib/mysql
139 - name: Stop and disable mysql service
141 service: name=mariadb state=stopped enabled=no