Debian Codegraph @

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

raw symbols SCIP
1 ---
2 - name: Consistency Group Operations
3 hosts: localhost
4 connection: local
5 vars:
6 unispherehost: '10.*.*.*'
7 validate_certs: false
8 username: 'user'
9 password: '***'
10 cg_name: 'Ansible_CG_Testing'
11 new_cg_name: 'Ansible_CG_Rename_Testing'
12 description: "Ansible demo"
13 snap_schedule1: "Ansible_Test"
14 snap_schedule2: "CG_test_schedule"
15 tiering_policy1: "LOWEST"
16 state_present: "present"
17 state_absent: "absent"
18 vol_state_present: "present-in-group"
19 vol_state_absent: "absent-in-group"
20 mapping_state_present: "mapped"
21 mapping_state_absent: "unmapped"
22
23 tasks:
24 - name: Create consistency group with volume and host access
25 register: result_cg
26 consistencygroup:
27 unispherehost: "{{ unispherehost }}"
28 validate_certs: "{{ validate_certs }}"
29 username: "{{ username }}"
30 password: "{{ password }}"
31 cg_name: "{{ cg_name }}"
32 description: "{{ description }}"
33 snap_schedule: "{{ snap_schedule1 }}"
34 volumes:
35 - vol_name: "Test_cg_vol-1"
36 vol_state: "{{ vol_state_present }}"
37 hosts:
38 - host_name: "10.*.*.*"
39 - host_id: "Host_511"
40 mapping_state: "{{ mapping_state_present }}"
41 state: "{{ state_present }}"
42
43 - name: Set cg_id
44 ansible.builtin.set_fact:
45 cg_id: "{{ result_cg.consistency_group_details.id }}"
46
47 - name: Get details of consistency group using id
48 consistencygroup:
49 unispherehost: "{{ unispherehost }}"
50 username: "{{ username }}"
51 password: "{{ password }}"
52 validate_certs: "{{ validate_certs }} "
53 cg_id: "{{ cg_id }}"
54 state: "{{ state_present }}"
55
56 - name: Add volumes to consistency group
57 consistencygroup:
58 unispherehost: "{{ unispherehost }}"
59 username: "{{ username }}"
60 password: "{{ password }}"
61 validate_certs: "{{ validate_certs }}"
62 cg_id: "{{ cg_id }}"
63 volumes:
64 - vol_name: "Test_cg_vol-2"
65 - vol_id: "sv_8984"
66 vol_state: "{{ vol_state_present }}"
67 state: "{{ state_present }}"
68
69 - name: Add volumes to consistency group - Idempotency
70 consistencygroup:
71 unispherehost: "{{ unispherehost }}"
72 username: "{{ username }}"
73 password: "{{ password }}"
74 validate_certs: "{{ validate_certs }}"
75 cg_id: "{{ cg_id }}"
76 volumes:
77 - vol_name: "Test_cg_vol-2"
78 - vol_id: "sv_8984"
79 vol_state: "{{ vol_state_present }}"
80 state: "{{ state_present }}"
81
82 - name: Rename consistency group
83 consistencygroup:
84 unispherehost: "{{ unispherehost }}"
85 username: "{{ username }}"
86 password: "{{ password }}"
87 validate_certs: "{{ validate_certs }}"
88 cg_name: "{{ cg_name }}"
89 new_cg_name: "{{ new_cg_name }}"
90 state: "{{ state_present }}"
91
92 - name: Rename consistency group - Idempotency
93 consistencygroup:
94 unispherehost: "{{ unispherehost }}"
95 username: "{{ username }}"
96 password: "{{ password }}"
97 validate_certs: "{{ validate_certs }}"
98 cg_name: "{{ new_cg_name }}"
99 new_cg_name: "{{ new_cg_name }}"
100 state: "{{ state_present }}"
101
102 - name: Modify consistency group details
103 consistencygroup:
104 unispherehost: "{{ unispherehost }}"
105 username: "{{ username }}"
106 password: "{{ password }}"
107 validate_certs: "{{ validate_certs }}"
108 cg_name: "{{ new_cg_name }}"
109 snap_schedule: "{{ snap_schedule2 }}"
110 tiering_policy: "{{ tiering_policy1 }}"
111 state: "{{ state_present }}"
112
113 - name: Modify consistency group details - Idempotency
114 consistencygroup:
115 unispherehost: "{{ unispherehost }}"
116 username: "{{ username }}"
117 password: "{{ password }}"
118 validate_certs: "{{ validate_certs }}"
119 cg_name: "{{ new_cg_name }}"
120 snap_schedule: "{{ snap_schedule2 }}"
121 tiering_policy: "{{ tiering_policy1 }}"
122 state: "{{ state_present }}"
123
124 - name: Map host to consistency group
125 consistencygroup:
126 unispherehost: "{{ unispherehost }}"
127 username: "{{ username }}"
128 password: "{{ password }}"
129 validate_certs: "{{ validate_certs }}"
130 cg_name: "{{ new_cg_name }}"
131 hosts:
132 - host_name: "10.*.*.*"
133 mapping_state: "{{ mapping_state_present }}"
134 state: "{{ state_present }}"
135
136 - name: Map host to consistency group -- Idempotency
137 consistencygroup:
138 unispherehost: "{{ unispherehost }}"
139 username: "{{ username }}"
140 password: "{{ password }}"
141 validate_certs: "{{ validate_certs }}"
142 cg_name: "{{ new_cg_name }}"
143 hosts:
144 - host_name: "10.*.*.*"
145 mapping_state: "{{ mapping_state_present }}"
146 state: "{{ state_present }}"
147
148 - name: Unmap host to consistency group
149 consistencygroup:
150 unispherehost: "{{ unispherehost }}"
151 username: "{{ username }}"
152 password: "{{ password }}"
153 validate_certs: "{{ validate_certs }}"
154 cg_name: "{{ new_cg_name }}"
155 hosts:
156 - host_name: "10.*.*.*"
157 - host_id: "Host_511"
158 mapping_state: "{{ mapping_state_absent }}"
159 state: "{{ state_present }}"
160
161 - name: Unmap host to consistency group -- Idempotency
162 consistencygroup:
163 unispherehost: "{{ unispherehost }}"
164 username: "{{ username }}"
165 password: "{{ password }}"
166 validate_certs: "{{ validate_certs }}"
167 cg_name: "{{ new_cg_name }}"
168 hosts:
169 - host_name: "10.*.*.*"
170 - host_id: "Host_511"
171 mapping_state: "{{ mapping_state_absent }}"
172 state: "{{ state_present }}"
173
174 - name: Remove volumes from consistency group
175 consistencygroup:
176 unispherehost: "{{ unispherehost }}"
177 username: "{{ username }}"
178 password: "{{ password }}"
179 validate_certs: "{{ validate_certs }}"
180 cg_name: "{{ new_cg_name }}"
181 volumes:
182 - vol_name: "Test_cg_vol-1"
183 - vol_name: "Test_cg_vol-2"
184 - vol_id: "sv_8984"
185 vol_state: "{{ vol_state_absent }}"
186 state: "{{ state_present }}"
187
188 - name: Remove volumes from consistency group - Idempotency
189 consistencygroup:
190 unispherehost: "{{ unispherehost }}"
191 username: "{{ username }}"
192 password: "{{ password }}"
193 validate_certs: "{{ validate_certs }}"
194 cg_name: "{{ new_cg_name }}"
195 volumes:
196 - vol_name: "Test_cg_vol-1"
197 - vol_name: "Test_cg_vol-2"
198 - vol_id: "sv_8984"
199 vol_state: "{{ vol_state_absent }}"
200 state: "{{ state_present }}"
201
202 - name: Delete consistency group
203 consistencygroup:
204 unispherehost: "{{ unispherehost }}"
205 username: "{{ username }}"
206 password: "{{ password }}"
207 validate_certs: "{{ validate_certs }}"
208 cg_name: "{{ new_cg_name }}"
209 state: "{{ state_absent }}"
210
211 - name: Delete consistency group Idempotency
212 consistencygroup:
213 unispherehost: "{{ unispherehost }}"
214 username: "{{ username }}"
215 password: "{{ password }}"
216 validate_certs: "{{ validate_certs }}"
217 cg_name: "{{ new_cg_name }}"
218 state: "{{ state_absent }}"
219
220 - name: Enable replication for consistency group
221 consistencygroup:
222 unispherehost: "{{ unispherehost }}"
223 username: "{{ username }}"
224 password: "{{ password }}"
225 validate_certs: "{{ validate_certs }}"
226 cg_name: "dis_repl_ans_source"
227 replication_params:
228 destination_cg_name: "destination_dis_repl_ans_source"
229 replication_mode: "asynchronous"
230 rpo: 60
231 replication_type: "remote"
232 remote_system:
233 remote_system_host: '10.*.*.*'
234 remote_system_verifycert: false
235 remote_system_username: 'user'
236 remote_system_password: '**'
237 destination_pool_name: "Extreme_Perf_tier"
238 replication_state: "enable"
239 state: "present"
240
241 - name: Disable replication for consistency group
242 consistencygroup:
243 unispherehost: "{{ unispherehost }}"
244 username: "{{ username }}"
245 password: "{{ password }}"
246 validate_certs: "{{ validate_certs }}"
247 cg_name: "dis_repl_ans_source"
248 replication_state: "disable"
249 state: "present"
250
251 - name: Disable replication for consistency group Idempotency
252 consistencygroup:
253 unispherehost: "{{ unispherehost }}"
254 username: "{{ username }}"
255 password: "{{ password }}"
256 validate_certs: "{{ validate_certs }}"
257 cg_name: "dis_repl_ans_source"
258 replication_state: "disable"
259 state: "present"