Merge "Containerize clustercheck galera monitor for HA deployments"
[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   EndpointMap:
18     default: {}
19     description: Mapping of service endpoint -> protocol. Typically set
20                  via parameter_defaults in the resource registry.
21     type: json
22   ServiceNetMap:
23     default: {}
24     description: Mapping of service_name -> network name. Typically set
25                  via parameter_defaults in the resource registry.  This
26                  mapping overrides those in ServiceNetMapDefaults.
27     type: json
28   DefaultPasswords:
29     default: {}
30     type: json
31   RoleName:
32     default: ''
33     description: Role name on which the service is applied
34     type: string
35   RoleParameters:
36     default: {}
37     description: Parameters specific to the role
38     type: json
39
40 resources:
41
42   ContainersCommon:
43     type: ../containers-common.yaml
44
45   MysqlPuppetBase:
46     type: ../../../puppet/services/pacemaker/database/mysql.yaml
47     properties:
48       EndpointMap: {get_param: EndpointMap}
49       ServiceNetMap: {get_param: ServiceNetMap}
50       DefaultPasswords: {get_param: DefaultPasswords}
51       RoleName: {get_param: RoleName}
52       RoleParameters: {get_param: RoleParameters}
53
54 outputs:
55   role_data:
56     description: Containerized service clustercheck using composable services.
57     value:
58       service_name: clustercheck
59       config_settings: {get_attr: [MysqlPuppetBase, role_data, config_settings]}
60       step_config: "include ::tripleo::profile::pacemaker::clustercheck"
61       # BEGIN DOCKER SETTINGS #
62       puppet_config:
63         config_volume: clustercheck
64         puppet_tags: file # set this even though file is the default
65         step_config: "include ::tripleo::profile::pacemaker::clustercheck"
66         config_image: &clustercheck_image
67           list_join:
68             - '/'
69             - [ {get_param: DockerNamespace}, {get_param: DockerClustercheckImage} ]
70       kolla_config:
71         /var/lib/kolla/config_files/clustercheck.json:
72           command: /usr/sbin/xinetd -dontfork
73           config_files:
74           - dest: /etc/xinetd.conf
75             source: /var/lib/kolla/config_files/src/etc/xinetd.conf
76             owner: mysql
77             perm: '0644'
78           - dest: /etc/xinetd.d/galera-monitor
79             source: /var/lib/kolla/config_files/src/etc/xinetd.d/galera-monitor
80             owner: mysql
81             perm: '0644'
82           - dest: /etc/sysconfig/clustercheck
83             source: /var/lib/kolla/config_files/src/etc/sysconfig/clustercheck
84             owner: mysql
85             perm: '0600'
86       docker_config:
87         step_2:
88           clustercheck:
89             start_order: 1
90             image: *clustercheck_image
91             restart: always
92             net: host
93             volumes:
94               list_concat:
95                 - {get_attr: [ContainersCommon, volumes]}
96                 -
97                   - /var/lib/kolla/config_files/clustercheck.json:/var/lib/kolla/config_files/config.json
98                   - /var/lib/config-data/clustercheck/:/var/lib/kolla/config_files/src:ro
99                   - /var/lib/mysql:/var/lib/mysql
100             environment:
101               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
102       host_prep_tasks:
103       upgrade_tasks: