summaryrefslogtreecommitdiff
path: root/deployment_tasks.yaml
blob: b5b292a00c822a47731a02449ce3850ddee6e23b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# Groups definitions
####################
- id: primary-elasticsearch_kibana
  type: group
  version: 2.0.0
  role: [primary-elasticsearch_kibana]
  tasks:
    - hiera
    - setup_repositories
    - fuel_pkgs
    - globals
    - tools
    - logging
    - elasticsearch-netconfig
    - hosts
    - elasticsearch-check-configuration
    - elasticsearch-hiera
    - elasticsearch-firewall
    - elasticsearch-cluster
    - elasticsearch-cluster-haproxy
    - elasticsearch-virtual-ip
    - elasticsearch-haproxy
    - elasticsearch-installation
  requires: [deploy_start]
  required_for: [deploy_end]
  parameters:
    strategy:
      type: one_by_one

- id: elasticsearch_kibana
  type: group
  version: 2.0.0
  role: [elasticsearch_kibana]
  tasks:
    - hiera
    - setup_repositories
    - fuel_pkgs
    - globals
    - tools
    - logging
    - elasticsearch-netconfig
    - hosts
    - elasticsearch-check-configuration
    - elasticsearch-hiera
    - elasticsearch-firewall
    - elasticsearch-cluster
    - elasticsearch-cluster-haproxy
    - elasticsearch-virtual-ip
    - elasticsearch-haproxy
    - elasticsearch-installation
  requires: [deploy_start, primary-elasticsearch_kibana]
  required_for: [deploy_end]
  parameters:
    strategy:
      type: parallel

# Tasks definitions for the deployment
######################################

# This task needs to be reexecuted to adapt the configuration parameters which
# depend on the number of nodes in the cluster
- id: elasticsearch-hiera
  type: puppet
  version: 2.0.0
  requires: [globals]
  required_for: [deploy_end]
  parameters:
    puppet_manifest: "puppet/manifests/hiera_override.pp"
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 120
  reexecute_on:
    - deploy_changes

# This task needs to be reexecuted to recheck that the configuration parameters
# match the node's characteristics (eg JVM size).
- id: elasticsearch-check-configuration
  type: puppet
  version: 2.0.0
  requires: [elasticsearch-hiera]
  required_for: [deploy_end]
  parameters:
    puppet_manifest: puppet/manifests/check_environment_configuration.pp
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 120
  reexecute_on:
    - deploy_changes

# We cannot use the legacy 'netconfig' task because it won't create the proper
# dependency on the virtual management router task.
- id: elasticsearch-netconfig
  type: puppet
  version: 2.0.0
  requires: [elasticsearch-check-configuration, virtual_ips]
  required_for: [deploy_end, hosts]
  cross-depends:
    - name: virtual_ips
      role: [primary-controller, controller]
  parameters:
    puppet_manifest: "/etc/puppet/modules/osnailyfacter/modular/netconfig/netconfig.pp"
    puppet_modules: /etc/puppet/modules
    timeout: 600
  reexecute_on:
    - deploy_changes

- id: elasticsearch-firewall
  type: puppet
  version: 2.0.0
  requires: [elasticsearch-netconfig]
  required_for: [deploy_end]
  parameters:
    puppet_manifest: "puppet/manifests/firewall.pp"
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 3600

- id: elasticsearch-cluster
  type: puppet
  version: 2.0.0
  requires: [elasticsearch-firewall]
  required_for: [deploy_end]
  parameters:
    puppet_manifest: "puppet/manifests/cluster.pp"
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 3600
  reexecute_on:
    - deploy_changes

- id: elasticsearch-cluster-haproxy
  type: puppet
  version: 2.0.0
  requires: [elasticsearch-cluster]
  required_for: [deploy_end]
  parameters:
    puppet_manifest: "puppet/manifests/cluster-haproxy.pp"
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 3600
  reexecute_on:
    - deploy_changes

- id: elasticsearch-virtual-ip
  type: puppet
  version: 2.0.0
  requires: [elasticsearch-cluster]
  required_for: [deploy_end]
  parameters:
    puppet_manifest: "/etc/puppet/modules/osnailyfacter/modular/virtual_ips/virtual_ips.pp"
    puppet_modules: /etc/puppet/modules
    timeout: 3600

# This task needs to be reexecuted to reconfigure HAProxy backends
- id: elasticsearch-haproxy
  type: puppet
  version: 2.0.0
  requires: [elasticsearch-cluster-haproxy, elasticsearch-virtual-ip]
  required_for: [deploy_end]
  parameters:
    puppet_manifest: "puppet/manifests/haproxy.pp"
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 120
  reexecute_on:
    - deploy_changes

# This task needs to be reexecuted to reconfigure Elasticsearch instances
- id: elasticsearch-installation
  type: puppet
  version: 2.0.0
  requires: [elasticsearch-haproxy]
  required_for: [deploy_end]
  parameters:
    puppet_manifest: puppet/manifests/elasticsearch.pp
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 600
  reexecute_on:
    - deploy_changes

# Tasks defintions for the post-deployment
##########################################

- id: elasticsearch-dns-client
  type: puppet
  version: 2.0.0
  role: [primary-elasticsearch_kibana, elasticsearch_kibana]
  requires: [post_deployment_start]
  required_for: [post_deployment_end]
  parameters:
    puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/dns/dns-client.pp
    puppet_modules: /etc/puppet/modules
    timeout: 600

- id: elasticsearch-ntp-client
  type: puppet
  version: 2.0.0
  role: [primary-elasticsearch_kibana, elasticsearch_kibana]
  requires: [elasticsearch-dns-client]
  required_for: [post_deployment_end]
  parameters:
    puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/ntp/ntp-client.pp
    puppet_modules: /etc/puppet/modules
    timeout: 600

# Configure the default gateway (required for MOS 8 only)
- id: elasticsearch-configure-default-route
  type: puppet
  version: 2.0.0
  role: [primary-elasticsearch_kibana, elasticsearch_kibana]
  requires: [post_deployment_start]
  required_for: [post_deployment_end]
  parameters:
    puppet_manifest: "puppet/manifests/configure_default_route.pp"
    puppet_modules: /etc/puppet/modules
    timeout: 120
  reexecute_on:
    - deploy_changes

# In order to automatically import dashboards, it is mandatory to create and
# configure the Kibana index before Kibana4 starts. This task is ran at post-deployment
# stage because the index creation must occur when the Elasticsearch cluster is ready
# (eg. all instances are started). This is required for MOS 8 (role-based deployment).
- id: provision-kibana-index
  type: puppet
  version: 2.0.0
  role: [primary-elasticsearch_kibana]
  requires: [post_deployment_start]
  required_for: [post_deployment_end]
  parameters:
    puppet_manifest: puppet/manifests/kibana_index_configuration.pp
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 600

- id: kibana-installation
  type: puppet
  version: 2.0.0
  role: [primary-elasticsearch_kibana, elasticsearch_kibana]
  cross-depends:
    - name: provision-kibana-index
      role: [primary-elasticsearch_kibana]
  requires: [post_deployment_start, provision-kibana-index]
  required_for: [post_deployment_end]
  parameters:
    puppet_manifest: puppet/manifests/kibana.pp
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 600

# This task needs to be reexecuted to reconfigure the index templates with an
# appropriate number_of_replicas.
# This is done at post_deployment time to ensure that the cluster is ready.
- id: elasticsearch-kibana-configuration
  type: puppet
  version: 2.0.0
  role: [primary-elasticsearch_kibana]
  requires: [post_deployment_start, kibana-installation]
  # We use upload_nodes_info as an anchor to order the post-deployment tasks executed
  # by this plugin and the LMA collector plugin. The dependency chain is like this:
  # elasticsearch-kibana-configuration -> upload_nodes_info -> (LMA collector tasks)
  required_for: [upload_nodes_info, post_deployment_end]
  parameters:
    puppet_manifest: puppet/manifests/provision_services.pp
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 600
  reexecute_on:
    - deploy_changes

# This task needs to be reexecuted to reconfigure the no-quorum-policy every
# time the cluster is scaled up or down. In case of scale up, it should happen
# after the new nodes have added themselves to the Pacemaker cluster.
- id: elasticsearch-enable-quorum
  type: puppet
  version: 2.0.0
  role: [primary-elasticsearch_kibana]
  requires: [elasticsearch-kibana-configuration]
  required_for: [post_deployment_end]
  parameters:
    puppet_manifest: "puppet/manifests/enable_quorum.pp"
    puppet_modules: puppet/modules:/etc/puppet/modules
    timeout: 120
  reexecute_on:
    - deploy_changes