1 heat_template_version: pike
4 MySQL service deployment with pacemaker bundle
9 default: 'tripleoupstream'
13 default: 'centos-binary-mariadb:latest'
15 DockerMysqlConfigImage:
16 description: The container image to use for the mysql config_volume
17 default: 'centos-binary-mariadb:latest'
21 description: Mapping of service endpoint -> protocol. Typically set
22 via parameter_defaults in the resource registry.
26 description: Mapping of service_name -> network name. Typically set
27 via parameter_defaults in the resource registry. This
28 mapping overrides those in ServiceNetMapDefaults.
39 description: Role name on which the service is applied
43 description: Parameters specific to the role
49 type: ../../containers-common.yaml
52 type: ../../../../puppet/services/pacemaker/database/mysql.yaml
54 EndpointMap: {get_param: EndpointMap}
55 ServiceNetMap: {get_param: ServiceNetMap}
56 DefaultPasswords: {get_param: DefaultPasswords}
57 RoleName: {get_param: RoleName}
58 RoleParameters: {get_param: RoleParameters}
62 description: Containerized service MySQL using composable services.
64 service_name: {get_attr: [MysqlPuppetBase, role_data, service_name]}
67 - {get_attr: [MysqlPuppetBase, role_data, config_settings]}
68 - tripleo::profile::pacemaker::database::mysql_bundle::mysql_docker_image: &mysql_image
71 - - {get_param: DockerNamespace}
72 - {get_param: DockerMysqlImage}
74 # BEGIN DOCKER SETTINGS #
77 puppet_tags: file # set this even though file is the default
81 - - "['Mysql_datadir', 'Mysql_user', 'Mysql_database', 'Mysql_grant', 'Mysql_plugin'].each |String $val| { noop_resource($val) }"
82 - "exec {'wait-for-settle': command => '/bin/true' }"
83 - "include ::tripleo::profile::pacemaker::database::mysql_bundle"
87 - [ {get_param: DockerNamespace}, {get_param: DockerMysqlConfigImage} ]
89 /var/lib/kolla/config_files/mysql.json:
90 command: /usr/sbin/pacemaker_remoted
92 - dest: /etc/libqb/force-filesystem-sockets
97 source: /var/lib/kolla/config_files/src/etc/my.cnf
100 - dest: /etc/my.cnf.d/galera.cnf
101 source: /var/lib/kolla/config_files/src/etc/my.cnf.d/galera.cnf
104 - dest: /etc/sysconfig/clustercheck
105 source: /var/lib/kolla/config_files/src/etc/sysconfig/clustercheck
110 mysql_data_ownership:
116 # Kolla does only non-recursive chown
117 command: ['chown', '-R', 'mysql:', '/var/lib/mysql']
119 - /var/lib/mysql:/var/lib/mysql
125 # Kolla bootstraps aren't idempotent, explicitly checking if bootstrap was done
126 command: ['bash', '-c', 'test -e /var/lib/mysql/mysql || kolla_start']
127 volumes: &mysql_volumes
129 - {get_attr: [ContainersCommon, volumes]}
131 - /var/lib/kolla/config_files/mysql.json:/var/lib/kolla/config_files/config.json
132 - /var/lib/config-data/mysql/:/var/lib/kolla/config_files/src:ro
133 - /var/lib/mysql:/var/lib/mysql
135 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
136 - KOLLA_BOOTSTRAP=True
137 # NOTE(mandre) skip wsrep cluster status check
138 - KOLLA_KUBERNETES=True
142 - - 'DB_ROOT_PASSWORD'
145 expression: $.data.passwords.where($ != '').first()
148 - {get_param: MysqlRootPassword}
149 - {get_param: [DefaultPasswords, mysql_root_password]}
163 - - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
164 - "FACTER_uuid=docker puppet apply --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
166 TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation,galera_ready,mysql_database,mysql_grant,mysql_user'
167 CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::database::mysql_bundle'
170 - /etc/hosts:/etc/hosts:ro
171 - /etc/localtime:/etc/localtime:ro
172 - /etc/puppet:/tmp/puppet-etc:ro
173 - /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
174 - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
175 - /dev/shm:/dev/shm:rw
176 - /var/lib/config-data/mysql/etc/my.cnf:/etc/my.cnf:ro
177 - /var/lib/config-data/mysql/etc/my.cnf.d:/etc/my.cnf.d:ro
178 - /var/lib/mysql:/var/lib/mysql:rw
180 - name: create /var/lib/mysql
185 - name: Stop and disable mysql service
187 service: name=mariadb state=stopped enabled=no