Merge "Wrap ceilometer-upgrade in boostrap_host_exec"
[apex-tripleo-heat-templates.git] / puppet / services / pacemaker.yaml
1 heat_template_version: pike
2
3 description: >
4   Pacemaker service configured with Puppet
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   RoleName:
21     default: ''
22     description: Role name on which the service is applied
23     type: string
24   RoleParameters:
25     default: {}
26     description: Parameters specific to the role
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33   MonitoringSubscriptionPacemaker:
34     default: 'overcloud-pacemaker'
35     type: string
36   CorosyncIPv6:
37     default: false
38     description: Enable IPv6 in Corosync
39     type: boolean
40   EnableFencing:
41     default: false
42     description: Whether to enable fencing in Pacemaker or not.
43     type: boolean
44   PacemakerRemoteAuthkey:
45     type: string
46     description: The authkey for the pacemaker remote service.
47     hidden: true
48     default: ''
49   PcsdPassword:
50     type: string
51     description: The password for the 'pcsd' user for pacemaker.
52     hidden: true
53     default: ''
54   CorosyncSettleTries:
55     type: number
56     description: Number of tries for cluster settling. This has the
57                  same default as the pacemaker puppet module. Override
58                  to a smaller value when in need to replace a controller node.
59     default: 360
60   FencingConfig:
61     default: {}
62     description: |
63       Pacemaker fencing configuration. The JSON should have
64       the following structure:
65         {
66           "devices": [
67             {
68               "agent": "AGENT_NAME",
69               "host_mac": "HOST_MAC_ADDRESS",
70               "params": {"PARAM_NAME": "PARAM_VALUE"}
71             }
72           ]
73         }
74       For instance:
75         {
76           "devices": [
77             {
78               "agent": "fence_xvm",
79               "host_mac": "52:54:00:aa:bb:cc",
80               "params": {
81                 "multicast_address": "225.0.0.12",
82                 "port": "baremetal_0",
83                 "manage_fw": true,
84                 "manage_key_file": true,
85                 "key_file": "/etc/fence_xvm.key",
86                 "key_file_password": "abcdef"
87               }
88             }
89           ]
90         }
91     type: json
92   PacemakerLoggingSource:
93     type: json
94     default:
95       tag: system.pacemaker
96       path: /var/log/pacemaker.log,/var/log/cluster/corosync.log
97       format: >-
98         /^(?<time>[^ ]*\s*[^ ]* [^ ]*)
99         \[(?<pid>[^ ]*)\]
100         (?<host>[^ ]*)
101         (?<message>.*)$/
102
103   EnableLoadBalancer:
104     default: true
105     description: Whether to deploy a LoadBalancer on the Controller
106     type: boolean
107
108   PacemakerResources:
109     type: comma_delimited_list
110     description: List of resources managed by pacemaker
111     default: ['rabbitmq', 'galera']
112
113 outputs:
114   role_data:
115     description: Role data for the Pacemaker role.
116     value:
117       service_name: pacemaker
118       monitoring_subscription: {get_param: MonitoringSubscriptionPacemaker}
119       logging_groups:
120         - haclient
121       logging_source: {get_param: PacemakerLoggingSource}
122       config_settings:
123         pacemaker::corosync::cluster_name: 'tripleo_cluster'
124         pacemaker::corosync::manage_fw: false
125         pacemaker::resource_defaults::defaults:
126           resource-stickiness: { value: INFINITY }
127         corosync_token_timeout: 10000
128         pacemaker::corosync::settle_tries: {get_param: CorosyncSettleTries}
129         tripleo.pacemaker.firewall_rules:
130           '130 pacemaker tcp':
131             proto: 'tcp'
132             dport:
133               - 2224
134               - 3121
135               - 21064
136           '131 pacemaker udp':
137             proto: 'udp'
138             dport: 5405
139         corosync_ipv6: {get_param: CorosyncIPv6}
140         tripleo::fencing::config: {get_param: FencingConfig}
141         enable_fencing: {get_param: EnableFencing}
142         hacluster_pwd:
143           yaql:
144             expression: $.data.passwords.where($ != '').first()
145             data:
146               passwords:
147                 - {get_param: PcsdPassword}
148                 - {get_param: [DefaultPasswords, pcsd_password]}
149         tripleo::profile::base::pacemaker::remote_authkey: {get_param: PacemakerRemoteAuthkey}
150       step_config: |
151         include ::tripleo::profile::base::pacemaker
152       upgrade_tasks:
153         - name: Check pacemaker cluster running before upgrade
154           tags: step0,validation
155           pacemaker_cluster: state=online check_and_fail=true
156           async: 30
157           poll: 4
158         - name: Stop pacemaker cluster
159           tags: step2
160           pacemaker_cluster: state=offline
161         - name: Start pacemaker cluster
162           tags: step4
163           pacemaker_cluster: state=online
164         - name: Check pacemaker resource
165           tags: step4
166           pacemaker_is_active:
167             resource: "{{ item }}"
168             max_wait: 500
169           with_items: {get_param: PacemakerResources}
170         - name: Check pacemaker haproxy resource
171           tags: step4
172           pacemaker_is_active:
173             resource: haproxy
174             max_wait: 500
175           when: {get_param: EnableLoadBalancer}