-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment_tasks.yaml
297 lines (276 loc) · 8.67 KB
/
deployment_tasks.yaml
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# Groups definitions
- id: primary-influxdb_grafana
type: group
version: 2.0.0
role: [primary-influxdb_grafana]
tasks:
- hiera
- setup_repositories
- fuel_pkgs
- globals
- tools
- logging
- influxdb-netconfig
- influxdb-hiera
- grafana-validate-certificate
- influxdb-firewall
- influxdb-cluster
- influxdb-cluster-haproxy
- influxdb-vip
- influxdb-haproxy
- influxdb-installation
requires: [deploy_start]
required_for: [deploy_end]
parameters:
strategy:
type: one_by_one
- id: influxdb_grafana
type: group
version: 2.0.0
role: [influxdb_grafana]
tasks:
- hiera
- setup_repositories
- fuel_pkgs
- globals
- tools
- logging
- influxdb-netconfig
- influxdb-hiera
- influxdb-firewall
- influxdb-cluster
- influxdb-cluster-haproxy
- influxdb-vip
- influxdb-haproxy
- influxdb-installation
requires: [deploy_start, primary-influxdb_grafana]
required_for: [deploy_end]
parameters:
strategy:
type: parallel
# Tasks definitions for the deployment
######################################
- id: influxdb-hiera
type: puppet
version: 2.0.0
requires: [globals]
required_for: [logging]
parameters:
puppet_manifest: "puppet/manifests/hiera.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 120
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
# We cannot use the legacy 'netconfig' task because with MOS 9, it won't create
# the proper dependency on the 'virtual_ips' task for the InfluxDB-Grafana
# nodes. As a consequence, the deployment will fail because the nodes will
# perform operations that download stuff from the Internet (like running
# 'apt-get update') while the virtual router isn't ready yet. For MOS 8, the
# task depends on the 'tools' task and not on the 'virtual_ips' task otherwise
# it creates a dependency cycle. In this case, this isn't an issue because the
# default gateway is only changed at post-deployment (see the
# 'influxdb-configure-default-route' task).
- id: influxdb-netconfig
type: puppet
version: 2.0.0
requires: [influxdb-hiera, tools]
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: grafana-validate-certificate
type: puppet
version: 2.0.0
requires: [influxdb-hiera]
required_for: [influxdb-firewall]
parameters:
puppet_manifest: "puppet/manifests/validate_certificate.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 120
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-firewall
type: puppet
version: 2.0.0
requires: [influxdb-netconfig]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/firewall.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: influxdb-cluster
type: puppet
version: 2.0.0
requires: [influxdb-firewall]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/cluster.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-cluster-haproxy
type: puppet
version: 2.0.0
requires: [influxdb-cluster]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/cluster-haproxy.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-vip
type: puppet
version: 2.0.0
requires: [influxdb-cluster]
required_for: [deploy_end]
parameters:
puppet_manifest: "/etc/puppet/modules/osnailyfacter/modular/virtual_ips/virtual_ips.pp"
puppet_modules: /etc/puppet/modules
timeout: 600
- id: influxdb-haproxy
type: puppet
version: 2.0.0
requires: [influxdb-cluster-haproxy, influxdb-vip]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/haproxy.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-installation
type: puppet
version: 2.0.0
requires: [influxdb-haproxy]
required_for: [deploy_end]
parameters:
puppet_manifest: "puppet/manifests/influxdb.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# Tasks definitions for the post-deployment
###########################################
- id: influxdb-dns-client
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana, influxdb-grafana]
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: influxdb-ntp-client
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana, influxdb-grafana]
requires: [influxdb-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: influxdb-configure-default-route
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana, influxdb-grafana]
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
- id: influxdb-enable-quorum
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana]
requires: [post_deployment_start]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/enable_quorum.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 120
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: influxdb-configuration
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana, influxdb_grafana]
requires: [post_deployment_start]
# 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:
# influxdb-configuration -> upload_nodes_info -> (LMA collector tasks)
# Note that it is only required for MOS 8 that doesn't support task-based deployment
required_for: [post_deployment_end, upload_nodes_info]
cross-depended-by:
- name: lma-configure-apt
role: /.*/
parameters:
puppet_manifest: "puppet/manifests/influxdb_configuration.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: grafana-mysql-provisioning
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana]
requires: [post_deployment_start]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/grafana_mysql.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
# Start Grafana only on the primary node since it will take care of the SQL
# migrations.
# See https://bugs.launchpad.net/lma-toolchain/+bug/1578183 for details
- id: primary-grafana-installation
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana]
requires: [post_deployment_start, grafana-mysql-provisioning]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/grafana.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: grafana-installation
type: puppet
version: 2.0.0
role: [influxdb_grafana]
requires: [post_deployment_start, primary-grafana-installation]
required_for: [post_deployment_end]
# The cross-depends parameter is required because the installation on the
# secondary nodes should only happen once the Grafana service has been
# started on the primary.
cross-depends:
- name: primary-grafana-installation
role: [primary-influxdb_grafana]
parameters:
puppet_manifest: "puppet/manifests/grafana.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600
- id: grafana-configuration
type: puppet
version: 2.0.0
role: [primary-influxdb_grafana]
requires: [post_deployment_start, primary-grafana-installation]
required_for: [post_deployment_end]
parameters:
puppet_manifest: "puppet/manifests/grafana_configuration.pp"
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 600