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