-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.yml
More file actions
615 lines (586 loc) · 17 KB
/
test.yml
File metadata and controls
615 lines (586 loc) · 17 KB
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
---
# Hello World
- hosts: myarray1
vars:
nimble_volume: "ansinimble-vol-handsfree"
nimble_perfpolicy: "ansinimble-perfpol1"
nimble_perfpolicy_options:
compress: True
description: "This is a description of my policy"
nimble_perfpolicy_update_options:
compress: False
roles:
- { role: debug_marker, local_test: "NLT-less operation" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: update,
nimble_object: volume,
nimble_volume_update_options: {
"limit_iops": 4000
}
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: perfpolicy
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: update,
nimble_object: perfpolicy
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: perfpolicy
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: cli,
nimble_object: group,
nimble_group_cli: "group --list"
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: cli,
nimble_object: group,
nimble_group_cli: "foobar",
nimble_group_cli_ignore_errors: True
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: update,
nimble_object: group,
nimble_group_update: {
login_banner_message: "This was put here as a test"
}
}
- hosts: myarray1
vars:
nimble_volume: "ansinimble-vol"
nimble_volume_pool: default
nimble_volume_perfpolicy: "Windows File Server"
nimble_volume_folder: "ansinimble-fldr"
nimble_folder: "ansinimble-fldr"
nimble_initiator_group_options:
description: "This is a description of my initiator group"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "First pass (array)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: folder
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: map,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: snapshot,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: update,
nimble_object: snapshot,
nimble_snapshot_update_options: {
description: "This is a description"
}
}
- hosts: myhost1
vars:
nimble_volume: "ansinimble-vol"
nimble_volume_mountpoint: "/mnt/ansinimble-vol"
roles:
- { role: debug_marker, local_test: "First pass (host)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: attach,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: mount,
nimble_object: volume
}
# Touch a file
- hosts: myhost1
become: yes
vars:
nimble_volume: "ansinimble-vol"
tasks:
- name: Touch a file
file:
path: "/mnt/{{ nimble_volume }}/myfile-known.txt"
state: touch
# Update folder and a known snap
- hosts: myarray1
vars:
nimble_folder: "ansinimble-fldr"
nimble_folder_update_options:
description: "This folder is smoked"
nimble_volume: "ansinimble-vol"
nimble_volume_snapshot: "ansinimble-snap"
roles:
- { role: debug_marker, local_test: "Update folders and create a snapshot" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: update,
nimble_object: folder
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: snapshot,
nimble_object: volume
}
tasks:
- name: Remove known file
file:
path: "/mnt/{{ nimble_volume }}/myfile-known.txt"
state: absent
# Create a clone from last snapshot
- hosts: myarray1
vars:
nimble_volume_from: "ansinimble-vol"
nimble_volume: "ansinimble-cln"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Create clone from last snapshot (array)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: map,
nimble_object: volume
}
- hosts: myhost1
vars:
nimble_volume: "ansinimble-cln"
nimble_volume_mountpoint: "/mnt/ansinimble-cln"
roles:
- { role: debug_marker, local_test: "Create clone from last snapshot (host)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: attach,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: mount,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: umount,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: detach,
nimble_object: volume
}
- hosts: myarray1
vars:
nimble_volume: "ansinimble-cln"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Create clone from last snapshot (array step #2)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: unmap,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: volume
}
# Create a clone from a known snapshot
- hosts: myarray1
vars:
nimble_volume_from: "ansinimble-vol"
nimble_volume: "ansinimble-cln"
nimble_volume_snapshot: "ansinimble-snap"
nimble_volume_mountpoint: "/mnt/ansinimble-cln"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Create clone from known snapshot (array)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: map,
nimble_object: volume
}
- hosts: myhost1
vars:
nimble_volume: "ansinimble-cln"
nimble_volume_mountpoint: "/mnt/ansinimble-cln"
roles:
- { role: debug_marker, local_test: "Create clone from known snapshot (host)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: attach,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: mount,
nimble_object: volume
}
# Ensure our file is in the clone
- hosts: myhost1
tasks:
- name: Is the file gone?
stat:
path: "/mnt/ansinimble-cln/myfile-known.txt"
register: nimble_file
- debug:
var: nimble_file
- name: Fail if not found
fail:
msg: Cloning failed, file does not exist
when: nimble_file.stat.exists is undefined
# Remove known clone
- hosts: myhost1
vars:
nimble_volume: "ansinimble-cln"
nimble_volume_mountpoint: "/mnt/ansinimble-cln"
roles:
- { role: debug_marker, local_test: "Remove known clone (host)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: umount,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: detach,
nimble_object: volume
}
- hosts: myarray1
vars:
nimble_volume: "ansinimble-cln"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Remove known clone (array)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: unmap,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: snapshot,
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: volume
}
# Touch a file
- hosts: myhost1
become: yes
vars:
nimble_volume: "ansinimble-vol"
tasks:
- name: Touch a file
file:
path: "/mnt/{{ nimble_volume }}/myfile.txt"
state: touch
# Unmap/unmount
- hosts: myhost1
vars:
nimble_volume: "ansinimble-vol"
nimble_volume_mountpoint: "/mnt/ansinimble-vol"
roles:
- { role: debug_marker, local_test: "Unmap/unmount for restore prep (host)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: umount,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: detach,
nimble_object: volume
}
- hosts: myarray1
vars:
nimble_volume: "ansinimble-vol"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Unmap/unmount for restore prep (array)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: unmap,
nimble_object: volume
}
# Restore from last snapshot
- hosts: myarray1
vars:
nimble_volume: "ansinimble-vol"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Restore volume (array)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: restore,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: map,
nimble_object: volume
}
- hosts: myhost1
vars:
nimble_volume: "ansinimble-vol"
nimble_volume_mountpoint: "/mnt/ansinimble-vol"
roles:
- { role: debug_marker, local_test: "Restore volume (host)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: attach,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: mount,
nimble_object: volume
}
- hosts: myhost1
vars:
nimble_volume: "ansinimble-vol"
tasks:
- name: Is the file gone?
stat:
path: "/mnt/{{ nimble_volume }}/myfile.txt"
register: nimble_file
- debug:
var: nimble_file
- name: Fail if still there
fail:
msg: Unable to restore volume
when: nimble_file.stat.exists
# Prep restore from a known snapshot
- hosts: myhost1
vars:
nimble_volume: "ansinimble-vol"
nimble_volume_mountpoint: "/mnt/ansinimble-vol"
roles:
- { role: debug_marker, local_test: "Unmap/unmount #2 (host)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: umount,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: detach,
nimble_object: volume
}
- hosts: myarray1
vars:
nimble_volume: "ansinimble-vol"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Unmap/unmount #2 (array)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: unmap,
nimble_object: volume
}
# Restore from known snapshot
- hosts: myarray1
vars:
nimble_volume_snapshot: "ansinimble-snap"
nimble_volume: "ansinimble-vol"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Restore from known snapshot (array)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: restore,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: map,
nimble_object: volume
}
- hosts: myhost1
vars:
nimble_volume: "ansinimble-vol"
nimble_volume_mountpoint: "/mnt/ansinimble-vol"
roles:
- { role: debug_marker, local_test: "Restore from known snapshot (host)" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: attach,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: mount,
nimble_object: volume
}
- hosts: myhost1
tasks:
- name: Is the file gone?
stat:
path: "/mnt/ansinimble-cln/myfile-known.txt"
register: nimble_file
- debug:
var: nimble_file
- name: Fail if not found
fail:
msg: Restoring failed, file does not exist
when: nimble_file.stat.exists is undefined
# Data protection
- hosts: myarray1
vars:
nimble_partner: "test"
roles:
- { role: debug_marker,
local_test: "Data protection (partner)"
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: partner,
nimble_object: replication,
}
tags:
- nopartner
- hosts: myarray1
vars:
nimble_volume: "ansinimble-vol"
roles:
- { role: debug_marker,
local_test: "Data protection (juggle)"
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: volcoll,
nimble_volcoll: "ansinimble-vol-manual",
nimble_protection_template: "Retain-30Daily"
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: protect,
nimble_object: volume,
nimble_volcoll: "ansinimble-vol-manual"
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: snapshot,
nimble_object: volcoll,
nimble_volcoll: "ansinimble-vol-manual"
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: snapshot,
nimble_object: volcoll,
nimble_volcoll_snapshot: mysnappyshot,
nimble_volcoll_update_options: {
description: "This is a manual description"
},
nimble_volcoll: "ansinimble-vol-manual"
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: unprotect,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: prune,
nimble_object: volcoll
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: protect,
nimble_object: volume,
nimble_protection_template: "Retain-30Daily"
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: unprotect,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: prune,
nimble_object: volcoll
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: create,
nimble_object: prottmpl,
nimble_protection_template: MyTestTemplate,
nimble_protection_schedules: {
myotherschedule: {
downstream_partner_id: "{{ nimble_partnerships.test.downstream.name }}",
num_retain_replica: 32,
description: "Create a snapshot daily during weekdays at 1am and retain 16 locally and 32 remotely",
period_unit: "days",
days: "monday,tuesday,wednesday,thursday,friday",
at_time: 3600,
num_retain: 16
}
}
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: prottmpl,
nimble_protection_template: MyTestTemplate
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: divorce,
nimble_object: replication,
nimble_partner: "{{ nimble_partnerships.test.upstream.name }}"
}
tags:
- nopartner
# Resize and delete
- hosts: myhost1
vars:
nimble_volume: "ansinimble-vol"
nimble_volume_size: 30000
nimble_volume_mountpoint: "/mnt/ansinimble-vol"
roles:
- { role: debug_marker, local_test: "Resize and detach" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: resize,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: umount,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: detach,
nimble_object: volume
}
- hosts: myarray1
vars:
nimble_folder: "ansinimble-fldr"
nimble_volume: "ansinimble-vol"
nimble_volume_size: 30000
nimble_volume_mountpoint: "/mnt/ansinimble-vol"
nimble_host_name: myhost1
roles:
- { role: debug_marker, local_test: "Delete" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: unmap,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: volume
}
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: delete,
nimble_object: folder
}
tags:
- wipe
- hosts: myarray2
roles:
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: divorce,
nimble_object: replication,
nimble_partner: "{{ nimble_partnerships.test.downstream.name }}",
nimble_group_options: {
username: "admin",
ip-address: "{{ nimble_upstream_test_partner }}"
}
}
tags:
- divorce
- nopartner
- hosts: myhost1
vars:
nimble_linux_toolkit_state: absent
roles:
- { role: debug_marker, local_test: "Uninstall NLT" }
- { role: NimbleStorage.AnsinimbleTest,
nimble_operation: manage,
nimble_object: nlt
}
tags:
- uninstall