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