007aa9c90e81f212b103893a84d46eb53899a769
[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             - source: "/var/lib/kolla/config_files/src/*"
79               dest: "/"
80               merge: true
81               preserve_properties: true
82       docker_config:
83         step_2:
84           clustercheck:
85             start_order: 1
86             image:
87               list_join:
88                 - '/'
89                 - [ {get_param: DockerNamespace}, {get_param: DockerClustercheckImage} ]
90             restart: always
91             net: host
92             volumes:
93               list_concat:
94                 - {get_attr: [ContainersCommon, volumes]}
95                 -
96                   - /var/lib/kolla/config_files/clustercheck.json:/var/lib/kolla/config_files/config.json
97                   - /var/lib/config-data/puppet-generated/clustercheck/:/var/lib/kolla/config_files/src:ro
98                   - /var/lib/mysql:/var/lib/mysql
99             environment:
100               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
101       host_prep_tasks:
102       upgrade_tasks: