@@ -131,85 +131,18 @@ Capturing the current storage configuration in order to verify it against best p
131
131
132
132
133
133
134
+ Used Playbook hierarchy:
134
135
135
136
136
137
138
+ * Capture-Systems.yaml
137
139
140
+ * DSCC-API-Call.yaml
141
+ * DSCC-API-401.yaml
142
+ * Loop-Systems.yaml
138
143
144
+ * Loop-Links.yaml
139
145
140
- ```
141
- ---
142
- - name: Capture System Configuration
143
- # Capture the details of all Systems
144
- # v1.0 12/20/2024 Thomas Beha
145
- # Parameter:
146
- # -
147
- #
148
- # Accessed data file:
149
- #
150
- #
151
- # Run command:
152
- # ansible-playbook Capture-Systems.yaml 1>CaptureSystem.log 2>CaptureSystem.err
153
- #
154
-
155
- hosts: localhost
156
- vars:
157
- method: "GET"
158
-
159
- tasks:
160
- - name: DSCC API Call GET storage systems
161
- vars:
162
- request_uri: "/api/v1/storage-systems"
163
- ansible.builtin.include_tasks:
164
- file: DSCC-API-Call.yaml
165
-
166
- - name: Retry the command if status 401
167
- vars:
168
- request_uri: "/api/v1/storage-systems"
169
- ansible.builtin.include_tasks:
170
- file: DSCC-API-401.yaml
171
- when: status == '401'
172
-
173
- - name: Set Systems
174
- ansible.builtin.set_fact:
175
- systems: "{{ response.json['items'] }}"
176
- when: status in ['200', '201']
177
-
178
- - name: Initialize Storage system dictionary if not defined
179
- ansible.builtin.set_fact:
180
- storage_systems: "{{ storage_systems | default({}) }}"
181
- - name: Create StorageSystems Dictionary
182
- ansible.builtin.set_fact:
183
- storage_systems: "{{ storage_systems | combine({item.name: {'id': item.id, 'resourceUri': item.resourceUri}}) }}"
184
- with_items: "{{ systems }}"
185
-
186
- - name: Loop Systems
187
- vars:
188
- ansible.builtin.include_tasks:
189
- file: Loop-Systems.yaml
190
- with_dict: "{{storage_systems}}"
191
- loop_control:
192
- loop_var: my_system
193
-
194
- - name: Get HostGroups
195
- vars:
196
- request_uri: "/api/v1/host-initiator-groups"
197
- ansible.builtin.include_tasks:
198
- file: DSCC-API-Call.yaml
199
- - name: Store the HostGroups
200
- ansible.builtin.copy:
201
- content: "{{ response.json | to_nice_json }}"
202
- dest: "../Outputs/hostGroups.json"
203
- mode: '0644'
204
- when: response.json is defined
205
-
206
- - name: Get Hosts
207
- ansible.builtin.include_tasks:
208
- file: GetAllHosts.yaml
209
- - name: Store the Hosts
210
- ansible.builtin.copy:
211
- content: "{{ response.json | to_nice_json }}"
212
- dest: "../Outputs/hosts.json"
213
- mode: '0644'
214
- when: response.json is defined
215
- ```
146
+
147
+
148
+ Playbooks currently stored at: < https://github.com/tbeha/DSCC-Ansible >
0 commit comments