Bump template version for all templates to "ocata"
[apex-tripleo-heat-templates.git] / puppet / services / database / mysql.yaml
1 heat_template_version: ocata
2
3 description: >
4   MySQL service deployment using puppet
5
6 parameters:
7   #Parameters not used EndpointMap
8   ServiceNetMap:
9     default: {}
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.
13     type: json
14   DefaultPasswords:
15     default: {}
16     type: json
17   EndpointMap:
18     default: {}
19     description: Mapping of service endpoint -> protocol. Typically set
20                  via parameter_defaults in the resource registry.
21     type: json
22   MysqlMaxConnections:
23     description: Configures MySQL max_connections config setting
24     type: number
25     default: 4096
26   MysqlRootPassword:
27     type: string
28     hidden: true
29     default: ''
30   MysqlClustercheckPassword:
31     type: string
32     hidden: true
33   EnableGalera:
34     default: true
35     description: Whether to use Galera instead of regular MariaDB.
36     type: boolean
37
38 resources:
39
40   MySQLTLS:
41     type: OS::TripleO::Services::MySQLTLS
42     properties:
43       ServiceNetMap: {get_param: ServiceNetMap}
44
45 outputs:
46   role_data:
47     description: Service MySQL using composable services.
48     value:
49       service_name: mysql
50       config_settings:
51         map_merge:
52           - get_attr: [MySQLTLS, role_data, config_settings]
53           -
54             # The Galera package should work in cluster and
55             # non-cluster modes based on the config file.
56             # We set the package name here explicitly so
57             # that it matches what we pre-install
58             # in tripleo-puppet-elements.
59             mysql::server::package_name: 'mariadb-galera-server'
60             mysql::server::manage_config_file: true
61             tripleo.mysql.firewall_rules:
62               '104 mysql galera':
63                 dport:
64                   - 873
65                   - 3306
66                   - 4444
67                   - 4567
68                   - 4568
69                   - 9200
70             mysql_max_connections: {get_param: MysqlMaxConnections}
71             mysql::server::root_password:
72               yaql:
73                 expression: $.data.passwords.where($ != '').first()
74                 data:
75                   passwords:
76                     - {get_param: MysqlRootPassword}
77                     - {get_param: [DefaultPasswords, mysql_root_password]}
78             mysql_clustercheck_password: {get_param: MysqlClustercheckPassword}
79             enable_galera: {get_param: EnableGalera}
80             # NOTE: bind IP is found in Heat replacing the network name with the
81             # local node IP for the given network; replacement examples
82             # (eg. for internal_api):
83             # internal_api -> IP
84             # internal_api_uri -> [IP]
85             # internal_api_subnet - > IP/CIDR
86             mysql_bind_host: {get_param: [ServiceNetMap, MysqlNetwork]}
87             tripleo::profile::base::database::mysql::bind_address:
88               str_replace:
89                 template:
90                   "%{hiera('fqdn_$NETWORK')}"
91                 params:
92                   $NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]}
93       step_config: |
94         include ::tripleo::profile::base::database::mysql
95       upgrade_tasks:
96         - name: Stop service
97           tags: step2
98           service: name=mariadb state=stopped
99         - name: Start service
100           tags: step4
101           service: name=mariadb state=started
102