1 heat_template_version: pike
4 MySQL service deployment using puppet
7 #Parameters not used EndpointMap
10 description: Mapping of service_name -> network name. Typically set
11 via parameter_defaults in the resource registry. This
12 mapping overrides those in ServiceNetMapDefaults.
19 description: Role name on which the service is applied
23 description: Parameters specific to the role
27 description: Mapping of service endpoint -> protocol. Typically set
28 via parameter_defaults in the resource registry.
31 description: Configures MySQL max_connections config setting
34 MysqlIncreaseFileLimit:
35 description: Flag to increase MySQL open-files-limit to 16384
42 MysqlClustercheckPassword:
47 description: Whether to use Galera instead of regular MariaDB.
50 description: The password for the nova db account
59 internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
63 description: Service MySQL using composable services.
69 # The Galera package should work in cluster and
70 # non-cluster modes based on the config file.
71 # We set the package name here explicitly so
72 # that it matches what we pre-install
73 # in tripleo-puppet-elements.
74 mysql::server::package_name: 'mariadb-galera-server'
75 mysql::server::manage_config_file: true
76 tripleo.mysql.firewall_rules:
85 mysql_max_connections: {get_param: MysqlMaxConnections}
86 mysql::server::root_password:
88 expression: $.data.passwords.where($ != '').first()
91 - {get_param: MysqlRootPassword}
92 - {get_param: [DefaultPasswords, mysql_root_password]}
93 mysql_clustercheck_password: {get_param: MysqlClustercheckPassword}
94 enable_galera: {get_param: EnableGalera}
95 # NOTE: bind IP is found in Heat replacing the network name with the
96 # local node IP for the given network; replacement examples
97 # (eg. for internal_api):
99 # internal_api_uri -> [IP]
100 # internal_api_subnet - > IP/CIDR
101 mysql_bind_host: {get_param: [ServiceNetMap, MysqlNetwork]}
102 tripleo::profile::base::database::mysql::bind_address:
105 "%{hiera('fqdn_$NETWORK')}"
107 $NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]}
108 tripleo::profile::base::database::mysql::client_bind_address:
109 {get_param: [ServiceNetMap, MysqlNetwork]}
110 tripleo::profile::base::database::mysql::generate_dropin_file_limit:
111 {get_param: MysqlIncreaseFileLimit}
112 - generate_service_certificates: true
113 tripleo::profile::base::database::mysql::certificate_specs:
114 service_certificate: '/etc/pki/tls/certs/mysql.crt'
115 service_key: '/etc/pki/tls/private/mysql.key'
118 template: "%{hiera('cloud_name_NETWORK')}"
120 NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]}
123 template: "mysql/%{hiera('cloud_name_NETWORK')}"
125 NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]}
127 include ::tripleo::profile::base::database::mysql
130 - internal_tls_enabled
133 network: {get_param: [ServiceNetMap, MysqlNetwork]}
137 - name: Check for galera root password
139 file: path=/root/.my.cnf state=file
142 service: name=mariadb state=stopped
143 - name: Start service
145 service: name=mariadb state=started
146 - name: Setup cell_v2 (create cell0 database)
151 - name: Setup cell_v2 (grant access to the nova DB user)
155 template: "name=nova password=PASSWORD host=\"%\" priv=\"nova.*:ALL/nova_cell0.*:ALL,GRANT\" state=present"
157 PASSWORD: {get_param: NovaPassword}