9fd9402fa283141f98374db77892038a8e9c1ff7
[apex-tripleo-heat-templates.git] / docker / services / pacemaker / clustercheck.yaml
1 heat_template_version: pike
2
3 description: >
4   MySQL HA clustercheck service deployment using puppet
5   This service is used by HAProxy in a HA scenario to report whether
6   the local galera node is synced
7
8 parameters:
9   DockerNamespace:
10     description: namespace
11     default: 'tripleoupstream'
12     type: string
13   DockerClustercheckImage:
14     description: image
15     default: 'centos-binary-mariadb:latest'
16     type: string
17   DockerClustercheckConfigImage:
18     description: The container image to use for the clustercheck config_volume
19     default: 'centos-binary-mariadb:latest'
20     type: string
21   EndpointMap:
22     default: {}
23     description: Mapping of service endpoint -> protocol. Typically set
24                  via parameter_defaults in the resource registry.
25     type: json
26   ServiceNetMap:
27     default: {}
28     description: Mapping of service_name -> network name. Typically set
29                  via parameter_defaults in the resource registry.  This
30                  mapping overrides those in ServiceNetMapDefaults.
31     type: json
32   DefaultPasswords:
33     default: {}
34     type: json
35   RoleName:
36     default: ''
37     description: Role name on which the service is applied
38     type: string
39   RoleParameters:
40     default: {}
41     description: Parameters specific to the role
42     type: json
43
44 resources:
45
46   ContainersCommon:
47     type: ../containers-common.yaml
48
49   MysqlPuppetBase:
50     type: ../../../puppet/services/pacemaker/database/mysql.yaml
51     properties:
52       EndpointMap: {get_param: EndpointMap}
53       ServiceNetMap: {get_param: ServiceNetMap}
54       DefaultPasswords: {get_param: DefaultPasswords}
55       RoleName: {get_param: RoleName}
56       RoleParameters: {get_param: RoleParameters}
57
58 outputs:
59   role_data:
60     description: Containerized service clustercheck using composable services.
61     value:
62       service_name: clustercheck
63       config_settings: {get_attr: [MysqlPuppetBase, role_data, config_settings]}
64       step_config: "include ::tripleo::profile::pacemaker::clustercheck"
65       # BEGIN DOCKER SETTINGS #
66       puppet_config:
67         config_volume: clustercheck
68         puppet_tags: file # set this even though file is the default
69         step_config: "include ::tripleo::profile::pacemaker::clustercheck"
70         config_image:
71           list_join:
72             - '/'
73             - [ {get_param: DockerNamespace}, {get_param: DockerClustercheckConfigImage} ]
74       kolla_config:
75         /var/lib/kolla/config_files/clustercheck.json:
76           command: /usr/sbin/xinetd -dontfork
77           config_files:
78           - dest: /etc/xinetd.conf
79             source: /var/lib/kolla/config_files/src/etc/xinetd.conf
80             owner: mysql
81             perm: '0644'
82           - dest: /etc/xinetd.d/galera-monitor
83             source: /var/lib/kolla/config_files/src/etc/xinetd.d/galera-monitor
84             owner: mysql
85             perm: '0644'
86           - dest: /etc/sysconfig/clustercheck
87             source: /var/lib/kolla/config_files/src/etc/sysconfig/clustercheck
88             owner: mysql
89             perm: '0600'
90       docker_config:
91         step_2:
92           clustercheck:
93             start_order: 1
94             image:
95               list_join:
96                 - '/'
97                 - [ {get_param: DockerNamespace}, {get_param: DockerClustercheckImage} ]
98             restart: always
99             net: host
100             volumes:
101               list_concat:
102                 - {get_attr: [ContainersCommon, volumes]}
103                 -
104                   - /var/lib/kolla/config_files/clustercheck.json:/var/lib/kolla/config_files/config.json
105                   - /var/lib/config-data/clustercheck/:/var/lib/kolla/config_files/src:ro
106                   - /var/lib/mysql:/var/lib/mysql
107             environment:
108               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
109       host_prep_tasks:
110       upgrade_tasks: