blob: 6ba31751be950f91d11bea1b6887029069c102f8 (
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
|
---
- name: setup
cs_instancegroup: name={{ cs_resource_prefix }}_ig state=absent
register: ig
- name: verify setup
assert:
that:
- ig is successful
- name: test fail if missing name
action: cs_instancegroup
register: ig
ignore_errors: true
- name: verify results of fail if missing name
assert:
that:
- ig is failed
- "ig.msg == 'missing required arguments: name'"
- name: test present instance group in check mode
cs_instancegroup: name={{ cs_resource_prefix }}_ig
register: ig
check_mode: true
- name: verify results of create instance group in check mode
assert:
that:
- ig is successful
- ig is changed
- name: test present instance group
cs_instancegroup: name={{ cs_resource_prefix }}_ig
register: ig
- name: verify results of create instance group
assert:
that:
- ig is successful
- ig is changed
- ig.name == "{{ cs_resource_prefix }}_ig"
- name: test present instance group is idempotence
cs_instancegroup: name={{ cs_resource_prefix }}_ig
register: ig
- name: verify results present instance group is idempotence
assert:
that:
- ig is successful
- ig is not changed
- ig.name == "{{ cs_resource_prefix }}_ig"
- name: test absent instance group in check mode
cs_instancegroup: name={{ cs_resource_prefix }}_ig state=absent
register: ig
check_mode: true
- name: verify results of absent instance group in check mode
assert:
that:
- ig is successful
- ig is changed
- ig.name == "{{ cs_resource_prefix }}_ig"
- name: test absent instance group
cs_instancegroup: name={{ cs_resource_prefix }}_ig state=absent
register: ig
- name: verify results of absent instance group
assert:
that:
- ig is successful
- ig is changed
- ig.name == "{{ cs_resource_prefix }}_ig"
- name: test absent instance group is idempotence
cs_instancegroup: name={{ cs_resource_prefix }}_ig state=absent
register: ig
- name: verify results of absent instance group is idempotence
assert:
that:
- ig is successful
- ig is not changed
- ig.name is undefined
|