Fix iptables rules override bug in clustercheck docker service
[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   DockerClustercheckImage:
10     description: image
11     type: string
12   DockerClustercheckConfigImage:
13     description: The container image to use for the clustercheck config_volume
14     type: string
15   EndpointMap:
16     default: {}
17     description: Mapping of service endpoint -> protocol. Typically set
18                  via parameter_defaults in the resource registry.
19     type: json
20   ServiceData:
21     default: {}
22     description: Dictionary packing service data
23     type: json
24   ServiceNetMap:
25     default: {}
26     description: Mapping of service_name -> network name. Typically set
27                  via parameter_defaults in the resource registry.  This
28                  mapping overrides those in ServiceNetMapDefaults.
29     type: json
30   DefaultPasswords:
31     default: {}
32     type: json
33   RoleName:
34     default: ''
35     description: Role name on which the service is applied
36     type: string
37   RoleParameters:
38     default: {}
39     description: Parameters specific to the role
40     type: json
41
42 resources:
43
44   ContainersCommon:
45     type: ../containers-common.yaml
46
47 # We import from the corresponding docker service because otherwise we risk
48 # rewriting the tripleo.mysql.firewall_rules key with the baremetal firewall
49 # rules (see LP#1728918)
50   MysqlPuppetBase:
51     type: ../../../docker/services/pacemaker/database/mysql.yaml
52     properties:
53       EndpointMap: {get_param: EndpointMap}
54       ServiceData: {get_param: ServiceData}
55       ServiceNetMap: {get_param: ServiceNetMap}
56       DefaultPasswords: {get_param: DefaultPasswords}
57       RoleName: {get_param: RoleName}
58       RoleParameters: {get_param: RoleParameters}
59
60 outputs:
61   role_data:
62     description: Containerized service clustercheck using composable services.
63     value:
64       service_name: clustercheck
65       config_settings: {get_attr: [MysqlPuppetBase, role_data, config_settings]}
66       logging_source: {get_attr: [MysqlPuppetBase, role_data, logging_source]}
67       logging_groups: {get_attr: [MysqlPuppetBase, role_data, logging_groups]}
68       step_config: "include ::tripleo::profile::pacemaker::clustercheck"
69       # BEGIN DOCKER SETTINGS #
70       puppet_config:
71         config_volume: clustercheck
72         puppet_tags: file # set this even though file is the default
73         step_config: "include ::tripleo::profile::pacemaker::clustercheck"
74         config_image: {get_param: DockerClustercheckConfigImage}
75       kolla_config:
76         /var/lib/kolla/config_files/clustercheck.json:
77           command: /usr/sbin/xinetd -dontfork
78           config_files:
79             - source: "/var/lib/kolla/config_files/src/*"
80               dest: "/"
81               merge: true
82               preserve_properties: true
83       docker_config:
84         step_2:
85           clustercheck:
86             start_order: 1
87             image: {get_param: DockerClustercheckImage}
88             restart: always
89             net: host
90             volumes:
91               list_concat:
92                 - {get_attr: [ContainersCommon, volumes]}
93                 -
94                   - /var/lib/kolla/config_files/clustercheck.json:/var/lib/kolla/config_files/config.json
95                   - /var/lib/config-data/puppet-generated/clustercheck/:/var/lib/kolla/config_files/src:ro
96                   - /var/lib/mysql:/var/lib/mysql
97             environment:
98               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
99       host_prep_tasks:
100       upgrade_tasks:
101       update_tasks:
102         # Nothing: It's not managed by pacemaker, so let paunch do it.