0a7659e0ea710df0e7c0881e6b8afb8328b8975f
[apex-tripleo-heat-templates.git] / puppet / services / pacemaker / database / mysql.yaml
1 heat_template_version: pike
2
3 description: >
4   MySQL with Pacemaker 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   RoleName:
18     default: ''
19     description: Role name on which the service is applied
20     type: string
21   RoleParameters:
22     default: {}
23     description: Parameters specific to the role
24     type: json
25   EndpointMap:
26     default: {}
27     description: Mapping of service endpoint -> protocol. Typically set
28                  via parameter_defaults in the resource registry.
29     type: json
30   InternalTLSCAFile:
31     default: '/etc/ipa/ca.crt'
32     type: string
33     description: Specifies the default CA cert to use if TLS is used for
34                  services in the internal network.
35
36 resources:
37
38   MysqlBase:
39     type: ../../database/mysql.yaml
40     properties:
41       ServiceNetMap: {get_param: ServiceNetMap}
42       DefaultPasswords: {get_param: DefaultPasswords}
43       EndpointMap: {get_param: EndpointMap}
44       RoleName: {get_param: RoleName}
45       RoleParameters: {get_param: RoleParameters}
46
47 outputs:
48   role_data:
49     description: Service MySQL with Pacemaker using composable services.
50     value:
51       service_name: mysql
52       config_settings:
53         map_merge:
54           - get_attr: [MysqlBase, role_data, config_settings]
55           - tripleo::profile::pacemaker::database::mysql::bind_address:
56               str_replace:
57                 template:
58                   "%{hiera('fqdn_$NETWORK')}"
59                 params:
60                   $NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]}
61             # NOTE: bind IP is found in Heat replacing the network name with the
62             # local node IP for the given network; replacement examples
63             # (eg. for internal_api):
64             # internal_api -> IP
65             # internal_api_uri -> [IP]
66             # internal_api_subnet - > IP/CIDR
67             tripleo::profile::pacemaker::database::mysql::gmcast_listen_addr:
68               get_param: [ServiceNetMap, MysqlNetwork]
69             tripleo::profile::pacemaker::database::mysql::ca_file:
70               get_param: InternalTLSCAFile
71       step_config: |
72         include ::tripleo::profile::pacemaker::database::mysql
73       metadata_settings:
74         get_attr: [MysqlBase, role_data, metadata_settings]
75       upgrade_tasks:
76         - name: Check for galera root password
77           tags: step0
78           file: path=/root/.my.cnf state=file