Debian Codegraph @

ansible_collections/dellemc/unity/playbooks/modules/volume.yml

raw symbols SCIP
1 ---
2 - name: Volume Operations
3 hosts: localhost
4 connection: local
5 vars:
6 unispherehost: '10.*.*.*'
7 validate_certs: false
8 username: 'user'
9 password: '**'
10 vol_name: "Ansible_vol1_test"
11 new_vol_name: "New_Ansible_vol1_test"
12 size: 2
13 pool_name: "Ansible_Unity_SP_2"
14 cap_gb: "GB"
15 description: "Ansible demo"
16 snap_schedule: "Ansible_vol_snap_schedule1"
17 io_limit_policy: "Ansible_IO_limit1"
18 tiering_policy: "LOWEST"
19 is_thin: true
20 compression: true
21 sp: "SPA"
22 host_name: "10.*.*.*"
23 host_id: "Host_929"
24 vol_hosts:
25 - host_name: "10.*.*.*"
26 hlu: 1
27 - host_id: "Host_929"
28 hlu: 3
29 hlu: 2
30 state_present: "present"
31 state_absent: "absent"
32 state_mapped: "mapped"
33 state_unmapped: "unmapped"
34
35 tasks:
36 - name: Create Volume
37 volume:
38 unispherehost: "{{ unispherehost }}"
39 username: "{{ username }}"
40 password: "{{ password }}"
41 validate_certs: "{{ validate_certs }}"
42 vol_name: "{{ vol_name }}"
43 description: "{{ description }}"
44 pool_name: "{{ pool_name }}"
45 size: "{{ size }}"
46 cap_unit: "{{ cap_gb }}"
47 tiering_policy: "{{ tiering_policy }}"
48 is_thin: true
49 compression: true
50 advanced_dedup: true
51 state: "{{ state_present }}"
52 register: vol_result
53
54 - name: Create Volume - Idempotency
55 volume:
56 unispherehost: "{{ unispherehost }}"
57 username: "{{ username }}"
58 password: "{{ password }}"
59 validate_certs: "{{ validate_certs }}"
60 vol_name: "{{ vol_name }}"
61 description: "{{ description }}"
62 pool_name: "{{ pool_name }}"
63 size: "{{ size }}"
64 cap_unit: "{{ cap_gb }}"
65 tiering_policy: "{{ tiering_policy }}"
66 is_thin: true
67 compression: true
68 advanced_dedup: true
69 state: "{{ state_present }}"
70
71 - name: Set vol_id
72 ansible.builtin.set_fact:
73 vol_id: "{{ vol_result.volume_details.id }}"
74
75 - name: Expand Volume by volume id
76 volume:
77 unispherehost: "{{ unispherehost }}"
78 username: "{{ username }}"
79 password: "{{ password }}"
80 validate_certs: "{{ validate_certs }}"
81 vol_id: "{{ vol_id }}"
82 size: 5
83 cap_unit: "{{ cap_gb }}"
84 state: "{{ state_present }}"
85
86 - name: Modify Volume attributes
87 volume:
88 unispherehost: "{{ unispherehost }}"
89 username: "{{ username }}"
90 password: "{{ password }}"
91 validate_certs: "{{ validate_certs }}"
92 vol_name: "{{ vol_name }}"
93 tiering_policy: "AUTOTIER"
94 snap_schedule: "{{ snap_schedule }}"
95 io_limit_policy: "{{ io_limit_policy }}"
96 is_thin: true
97 compression: true
98 advanced_dedup: true
99 state: "{{ state_present }}"
100
101 - name: Modify Volume attributes - Idempotency
102 volume:
103 unispherehost: "{{ unispherehost }}"
104 username: "{{ username }}"
105 password: "{{ password }}"
106 validate_certs: "{{ validate_certs }}"
107 vol_name: "{{ vol_name }}"
108 tiering_policy: "AUTOTIER"
109 snap_schedule: "{{ snap_schedule }}"
110 io_limit_policy: "{{ io_limit_policy }}"
111 is_thin: true
112 compression: true
113 advanced_dedup: true
114 state: "{{ state_present }}"
115
116 - name: Remove snap_schedule from a Volume
117 volume:
118 unispherehost: "{{ unispherehost }}"
119 username: "{{ username }}"
120 password: "{{ password }}"
121 validate_certs: "{{ validate_certs }}"
122 vol_name: "{{ vol_name }}"
123 snap_schedule: ""
124 state: "{{ state_present }}"
125
126 - name: Map Host by host_name to Volume
127 volume:
128 unispherehost: "{{ unispherehost }}"
129 username: "{{ username }}"
130 password: "{{ password }}"
131 validate_certs: "{{ validate_certs }}"
132 vol_id: "{{ vol_id }}"
133 host_name: "{{ host_name }}"
134 hlu: "{{ hlu }}"
135 mapping_state: "{{ state_mapped }}"
136 state: "{{ state_present }}"
137
138 - name: Map Host by host_name to Volume- Idempotency
139 volume:
140 unispherehost: "{{ unispherehost }}"
141 username: "{{ username }}"
142 password: "{{ password }}"
143 validate_certs: "{{ validate_certs }}"
144 vol_id: "{{ vol_id }}"
145 host_name: "{{ host_name }}"
146 hlu: 2
147 mapping_state: "{{ state_mapped }}"
148 state: "{{ state_present }}"
149
150 - name: Unmap Host by host_name from Volume
151 volume:
152 unispherehost: "{{ unispherehost }}"
153 username: "{{ username }}"
154 password: "{{ password }}"
155 validate_certs: "{{ validate_certs }}"
156 vol_id: "{{ vol_id }}"
157 host_name: "{{ host_name }}"
158 mapping_state: "{{ state_unmapped }}"
159 state: "{{ state_present }}"
160
161 - name: Unmap Host by host_name from Volume -Idempotency
162 volume:
163 unispherehost: "{{ unispherehost }}"
164 username: "{{ username }}"
165 password: "{{ password }}"
166 validate_certs: "{{ validate_certs }}"
167 vol_id: "{{ vol_id }}"
168 host_name: "{{ host_name }}"
169 mapping_state: "{{ state_unmapped }}"
170 state: "{{ state_present }}"
171
172 - name: Map Multiple Hosts to a Volume
173 volume:
174 unispherehost: "{{ unispherehost }}"
175 username: "{{ username }}"
176 password: "{{ password }}"
177 validate_certs: "{{ validate_certs }}"
178 vol_id: "{{ vol_id }}"
179 hosts: "{{ vol_hosts }}"
180 mapping_state: "{{ state_mapped }}"
181 state: "{{ state_present }}"
182
183 - name: Map Multiple Hosts to a Volume - Idempotency
184 volume:
185 unispherehost: "{{ unispherehost }}"
186 username: "{{ username }}"
187 password: "{{ password }}"
188 validate_certs: "{{ validate_certs }}"
189 vol_id: "{{ vol_id }}"
190 hosts: "{{ vol_hosts }}"
191 mapping_state: "{{ state_mapped }}"
192 state: "{{ state_present }}"
193
194 - name: Unmap Hosts from Volume
195 volume:
196 unispherehost: "{{ unispherehost }}"
197 username: "{{ username }}"
198 password: "{{ password }}"
199 validate_certs: "{{ validate_certs }}"
200 vol_id: "{{ vol_id }}"
201 hosts: "{{ vol_hosts }}"
202 mapping_state: "{{ state_unmapped }}"
203 state: "{{ state_present }}"
204
205 - name: Unmap Hosts from Volume - Idempotency
206 volume:
207 unispherehost: "{{ unispherehost }}"
208 username: "{{ username }}"
209 password: "{{ password }}"
210 validate_certs: "{{ validate_certs }}"
211 vol_id: "{{ vol_id }}"
212 hosts: "{{ vol_hosts }}"
213 mapping_state: "{{ state_unmapped }}"
214 state: "{{ state_present }}"
215
216 - name: Get details of volume using id
217 volume:
218 unispherehost: "{{ unispherehost }}"
219 username: "{{ username }}"
220 password: "{{ password }}"
221 validate_certs: "{{ validate_certs }}"
222 vol_id: "{{ vol_id }}"
223 state: "present"
224
225 - name: Delete a volume using id
226 volume:
227 unispherehost: "{{ unispherehost }}"
228 username: "{{ username }}"
229 password: "{{ password }}"
230 validate_certs: "{{ validate_certs }}"
231 vol_id: "{{ vol_id }}"
232 state: "absent"
233
234 - name: Delete a volume using id -Idempotency
235 volume:
236 unispherehost: "{{ unispherehost }}"
237 username: "{{ username }}"
238 password: "{{ password }}"
239 validate_certs: "{{ validate_certs }}"
240 vol_id: "{{ vol_id }}"
241 state: "absent"