blob: 755394fad4ed37f2468acb20f84e7e0ecc82bcdf (
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
|
---
- name: setup template
cs_template:
name: "ansible-template-test1"
state: absent
register: template
- name: verify setup template
assert:
that:
- template is successful
- name: test download template in check mode
cs_template:
name: "ansible-template-test1"
url: "{{ cs_template_url }}"
format: "{{ cs_template_format }}"
hypervisor: "{{ cs_template_hypervisor }}"
os_type: "{{ cs_template_os_type }}"
cross_zones: yes
register: template
check_mode: yes
- name: verify test download template in check mode
assert:
that:
- template is changed
- name: test download template
cs_template:
name: "ansible-template-test1"
url: "{{ cs_template_url }}"
format: "{{ cs_template_format }}"
hypervisor: "{{ cs_template_hypervisor }}"
os_type: "{{ cs_template_os_type }}"
cross_zones: yes
register: template
- name: verify test download template
assert:
that:
- template is changed
- template.name == "ansible-template-test1"
- template.display_text == "ansible-template-test1"
- template.cross_zones == true
- name: test download template idempotence
cs_template:
name: "ansible-template-test1"
url: "{{ cs_template_url }}"
format: "{{ cs_template_format }}"
hypervisor: "{{ cs_template_hypervisor }}"
os_type: "{{ cs_template_os_type }}"
cross_zones: yes
register: template
- name: verify test download template idempotence
assert:
that:
- template is not changed
- template.name == "ansible-template-test1"
- template.display_text == "ansible-template-test1"
- template.cross_zones == true
- name: test update template in check mode
cs_template:
name: "ansible-template-test1"
display_text: "{{ cs_resource_prefix }}-template display_text"
url: "{{ cs_template_url }}"
format: "{{ cs_template_format }}"
hypervisor: "{{ cs_template_hypervisor }}"
os_type: "{{ cs_template_os_type }}"
is_featured: yes
cross_zones: yes
register: template
check_mode: yes
- name: verify test update template in check mode
assert:
that:
- template is changed
- template.name == "ansible-template-test1"
- template.display_text == "ansible-template-test1"
- template.cross_zones == true
- template.is_featured == false
- name: test update template
cs_template:
name: "ansible-template-test1"
display_text: "{{ cs_resource_prefix }}-template display_text"
url: "{{ cs_template_url }}"
format: "{{ cs_template_format }}"
hypervisor: "{{ cs_template_hypervisor }}"
os_type: "{{ cs_template_os_type }}"
is_featured: yes
cross_zones: yes
register: template
- name: verify test update template
assert:
that:
- template is changed
- template.name == "ansible-template-test1"
- template.display_text == "{{ cs_resource_prefix }}-template display_text"
- template.cross_zones == true
- template.is_featured == true
- name: test update template idempotence
cs_template:
name: "ansible-template-test1"
display_text: "{{ cs_resource_prefix }}-template display_text"
url: "{{ cs_template_url }}"
format: "{{ cs_template_format }}"
hypervisor: "{{ cs_template_hypervisor }}"
os_type: "{{ cs_template_os_type }}"
is_featured: yes
cross_zones: yes
register: template
- name: verify test update template idempotence
assert:
that:
- template is not changed
- template.name == "ansible-template-test1"
- template.display_text == "{{ cs_resource_prefix }}-template display_text"
- template.cross_zones == true
- template.is_featured == true
- name: test remove template in check mode
cs_template:
name: "ansible-template-test1"
state: absent
cross_zones: yes
register: template
check_mode: yes
- name: verify test remove template in check mode
assert:
that:
- template is changed
- template.name == "ansible-template-test1"
- template.display_text == "{{ cs_resource_prefix }}-template display_text"
- template.cross_zones == true
- name: test remove template
cs_template:
name: "ansible-template-test1"
state: absent
cross_zones: yes
register: template
- name: verify test remove template
assert:
that:
- template is changed
- template.name == "ansible-template-test1"
- template.display_text == "{{ cs_resource_prefix }}-template display_text"
- template.cross_zones == true
- name: test remove template idempotence
cs_template:
name: "ansible-template-test1"
state: absent
cross_zones: yes
register: template
- name: verify test remove template idempotence
assert:
that:
- template is not changed
|