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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
.. _host_module:
host -- Manage Host operations on Unity
=======================================
.. contents::
:local:
:depth: 1
Synopsis
--------
The Host module contains the operations Creation of a Host, Addition of initiators to Host, Removal of initiators from Host, Modification of host attributes, Get details of a Host, Deletion of a Host, Addition of network address to Host, Removal of network address from Host.
Requirements
------------
The below requirements are needed on the host that executes this module.
- A Dell Unity Storage device version 5.1 or later.
- Ansible-core 2.13 or later.
- Python 3.9, 3.10 or 3.11.
- Storops Python SDK 1.2.11.
Parameters
----------
host_name (optional, str, None)
Name of the host.
Mandatory for host creation.
host_id (optional, str, None)
Unique identifier of the host.
Host Id is auto generated during creation.
Except create, all other operations require either *host_id* or Ihost_name).
description (optional, str, None)
Host description.
host_os (optional, str, None)
Operating system running on the host.
new_host_name (optional, str, None)
New name for the host.
Only required in rename host operation.
initiators (optional, list, None)
List of initiators to be added/removed to/from host.
initiator_state (optional, str, None)
State of the initiator.
network_address (optional, str, None)
Network address to be added/removed to/from the host.
Enter valid IPV4 or host name.
network_address_state (optional, str, None)
State of the Network address.
state (True, str, None)
State of the host.
unispherehost (True, str, None)
IP or FQDN of the Unity management server.
username (True, str, None)
The username of the Unity management server.
password (True, str, None)
The password of the Unity management server.
validate_certs (optional, bool, True)
Boolean variable to specify whether or not to validate SSL certificate.
``true`` - Indicates that the SSL certificate should be verified.
``false`` - Indicates that the SSL certificate should not be verified.
port (optional, int, 443)
Port number through which communication happens with Unity management server.
Notes
-----
.. note::
- The *check_mode* is not supported.
- The modules present in this collection named as 'dellemc.unity' are built to support the Dell Unity storage platform.
Examples
--------
.. code-block:: yaml+jinja
- name: Create empty Host
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_name: "ansible-test-host"
host_os: "Linux"
description: "ansible-test-host"
state: "present"
- name: Create Host with Initiators
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_name: "ansible-test-host-1"
host_os: "Linux"
description: "ansible-test-host-1"
initiators:
- "iqn.1994-05.com.redhat:c38e6e8cfd81"
- "20:00:00:90:FA:13:81:8D:10:00:00:90:FA:13:81:8D"
initiator_state: "present-in-host"
state: "present"
- name: Modify Host using host_id
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_id: "Host_253"
new_host_name: "ansible-test-host-2"
host_os: "Mac OS"
description: "Ansible tesing purpose"
state: "present"
- name: Add Initiators to Host
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_name: "ansible-test-host-2"
initiators:
- "20:00:00:90:FA:13:81:8C:10:00:00:90:FA:13:81:8C"
initiator_state: "present-in-host"
state: "present"
- name: Get Host details using host_name
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_name: "ansible-test-host-2"
state: "present"
- name: Get Host details using host_id
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_id: "Host_253"
state: "present"
- name: Delete Host
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_name: "ansible-test-host-2"
state: "absent"
- name: Add network address to Host
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_name: "{{host_name}}"
network_address: "192.168.1.2"
network_address_state: "present-in-host"
state: "present"
- name: Delete network address from Host
dellemc.unity.host:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
host_name: "{{host_name}}"
network_address: "192.168.1.2"
network_address_state: "absent-in-host"
state: "present"
Return Values
-------------
changed (always, bool, True)
Whether or not the resource has changed.
host_details (When host exists., dict, {'auto_manage_type': 'HostManageEnum.UNKNOWN', 'datastores': None, 'description': 'ansible-test-host-1', 'existed': True, 'fc_host_initiators': [{'id': 'HostInitiator_1', 'name': 'HostName_1', 'paths': [{'id': 'HostInitiator_1_Id1', 'is_logged_in': True}, {'id': 'HostInitiator_1_Id2', 'is_logged_in': True}]}], 'hash': 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER', 'health': {'UnityHealth': {'hash': 8764429420954}}, 'host_container': None, 'host_luns': [], 'host_polled_uuid': None, 'host_pushed_uuid': None, 'host_uuid': None, 'host_v_vol_datastore': None, 'id': 'Host_2198', 'iscsi_host_initiators': [{'id': 'HostInitiator_2', 'name': 'HostName_2', 'paths': [{'id': 'HostInitiator_2_Id1', 'is_logged_in': True}, {'id': 'HostInitiator_2_Id2', 'is_logged_in': True}]}], 'last_poll_time': None, 'name': 'ansible-test-host-1', 'network_addresses': [], 'os_type': 'Linux', 'registration_type': None, 'storage_resources': None, 'tenant': None, 'type': 'HostTypeEnum.HOST_MANUAL', 'vms': None})
Details of the host.
id (, str, )
The system ID given to the host.
name (, str, )
The name of the host.
description (, str, )
Description about the host.
fc_host_initiators (, list, )
Details of the FC initiators associated with the host.
id (, str, )
Unique identifier of the FC initiator path.
name (, str, )
FC Qualified Name (WWN) of the initiator.
paths (, list, )
Details of the paths associated with the FC initiator.
id (, str, )
Unique identifier of the path.
is_logged_in (, bool, )
Indicates whether the host initiator is logged into the storage system.
iscsi_host_initiators (, list, )
Details of the ISCSI initiators associated with the host.
id (, str, )
Unique identifier of the ISCSI initiator path.
name (, str, )
ISCSI Qualified Name (IQN) of the initiator.
paths (, list, )
Details of the paths associated with the ISCSI initiator.
id (, str, )
Unique identifier of the path.
is_logged_in (, bool, )
Indicates whether the host initiator is logged into the storage system.
network_addresses (, list, )
List of network addresses mapped to the host.
os_type (, str, )
Operating system running on the host.
type (, str, )
HostTypeEnum of the host.
host_luns (, list, )
Details of luns attached to host.
Status
------
Authors
~~~~~~~
- Rajshree Khare (@kharer5) <ansible.team@dell.com>
|