Debian Codegraph @

ansible_collections/dellemc/openmanage/docs/modules/ome_discovery.rst

raw
1 .. _ome_discovery_module:
2
3
4 ome_discovery -- Create, modify, or delete a discovery job on OpenManage Enterprise
5 ===================================================================================
6
7 .. contents::
8 :local:
9 :depth: 1
10
11
12 Synopsis
13 --------
14
15 This module allows to create, modify, or delete a discovery job.
16
17
18
19 Requirements
20 ------------
21 The below requirements are needed on the host that executes this module.
22
23 - python \>= 3.9.6
24
25
26
27 Parameters
28 ----------
29
30 state (optional, str, present)
31 \ :literal:`present`\ creates a discovery job or modifies an existing discovery job.
32
33 \ :emphasis:`discovery\_job\_name`\ is mandatory for the creation of a new discovery job.
34
35 If multiple discoveries of the same \ :emphasis:`discovery\_job\_name`\ exist, then the new discovery job will not be created.
36
37 \ :literal:`absent`\ deletes an existing discovery job(s) with the specified \ :emphasis:`discovery\_job\_name`\ .
38
39
40 discovery_job_name (optional, str, None)
41 Name of the discovery configuration job.
42
43 It is mutually exclusive with \ :emphasis:`discovery\_id`\ .
44
45
46 discovery_id (optional, int, None)
47 ID of the discovery configuration group.
48
49 This value is DiscoveryConfigGroupId in the return values under discovery\_status.
50
51 It is mutually exclusive with \ :emphasis:`discovery\_job\_name`\ .
52
53
54 new_name (optional, str, None)
55 New name of the discovery configuration job.
56
57
58 schedule (optional, str, RunNow)
59 Provides the option to schedule the discovery job.
60
61 If \ :literal:`RunLater`\ is selected, then \ :emphasis:`cron`\ must be specified.
62
63
64 cron (optional, str, None)
65 Provide a cron expression based on Quartz cron format.
66
67
68 trap_destination (optional, bool, False)
69 Enable OpenManage Enterprise to receive the incoming SNMP traps from the discovered devices.
70
71 This is effective only for servers discovered by using their iDRAC interface.
72
73
74 community_string (optional, bool, False)
75 Enable the use of SNMP community strings to receive SNMP traps using Application Settings in OpenManage Enterprise. This option is available only for the discovered iDRAC servers and MX7000 chassis.
76
77
78 email_recipient (optional, str, None)
79 Enter the email address to which notifications are to be sent about the discovery job status. Configure the SMTP settings to allow sending notifications to an email address.
80
81
82 job_wait (optional, bool, True)
83 Provides the option to wait for job completion.
84
85 This option is applicable when \ :emphasis:`state`\ is \ :literal:`present`\ .
86
87
88 job_wait_timeout (optional, int, 10800)
89 The maximum wait time of \ :emphasis:`job\_wait`\ in seconds. The job is tracked only for this duration.
90
91 This option is applicable when \ :emphasis:`job\_wait`\ is \ :literal:`true`\ .
92
93
94 ignore_partial_failure (optional, bool, False)
95 Provides the option to ignore partial failures. Partial failures occur when there is a combination of both discovered and undiscovered IPs.
96
97 If \ :literal:`false`\ , then the partial failure is not ignored, and the module will error out.
98
99 If \ :literal:`true`\ , then the partial failure is ignored.
100
101 This option is only applicable if \ :emphasis:`job\_wait`\ is \ :literal:`true`\ .
102
103
104 discovery_config_targets (optional, list, None)
105 Provide the list of discovery targets.
106
107 Each discovery target is a set of \ :emphasis:`network\_address\_detail`\ , \ :emphasis:`device\_types`\ , and one or more protocol credentials.
108
109 This is mandatory when \ :emphasis:`state`\ is \ :literal:`present`\ .
110
111 \ :literal:`WARNING`\ Modification of this field is not supported, this field is overwritten every time. Ensure to provide all the required details for this field.
112
113
114 network_address_detail (True, list, None)
115 Provide the list of IP addresses, host names, or the range of IP addresses of the devices to be discovered or included.
116
117 Sample Valid IP Range Formats
118
119 192.35.0.0
120
121 192.36.0.0-10.36.0.255
122
123 192.37.0.0/24
124
125 2345:f2b1:f083:135::5500/118
126
127 2345:f2b1:f083:135::a500-2607:f2b1:f083:135::a600
128
129 hostname.domain.tld
130
131 hostname
132
133 2345:f2b1:f083:139::22a
134
135 Sample Invalid IP Range Formats
136
137 192.35.0.\*
138
139 192.36.0.0-255
140
141 192.35.0.0/255.255.255.0
142
143 \ :literal:`NOTE`\ The range size for the number of IP addresses is limited to 16,385 (0x4001).
144
145 \ :literal:`NOTE`\ Both IPv6 and IPv6 CIDR formats are supported.
146
147
148 device_types (True, list, None)
149 Provide the type of devices to be discovered.
150
151 The accepted types are SERVER, CHASSIS, NETWORK SWITCH, and STORAGE.
152
153 A combination or all of the above can be provided.
154
155 Supported protocols for each device type are:
156
157 SERVER - \ :emphasis:`wsman`\ , \ :emphasis:`redfish`\ , \ :emphasis:`snmp`\ , \ :emphasis:`ipmi`\ , \ :emphasis:`ssh`\ , and \ :emphasis:`vmware`\ .
158
159 CHASSIS - \ :emphasis:`wsman`\ , and \ :emphasis:`redfish`\ .
160
161 NETWORK SWITCH - \ :emphasis:`snmp`\ .
162
163 STORAGE - \ :emphasis:`storage`\ , and \ :emphasis:`snmp`\ .
164
165
166 wsman (optional, dict, None)
167 Web Services-Management (WS-Man).
168
169
170 username (True, str, None)
171 Provide a username for the protocol.
172
173
174 password (True, str, None)
175 Provide a password for the protocol.
176
177
178 domain (optional, str, None)
179 Provide a domain for the protocol.
180
181
182 port (optional, int, 443)
183 Enter the port number that the job must use to discover the devices.
184
185
186 retries (optional, int, 3)
187 Enter the number of repeated attempts required to discover a device.
188
189
190 timeout (optional, int, 60)
191 Enter the time in seconds after which a job must stop running.
192
193
194 cn_check (optional, bool, False)
195 Enable the Common Name (CN) check.
196
197
198 ca_check (optional, bool, False)
199 Enable the Certificate Authority (CA) check.
200
201
202 certificate_data (optional, str, None)
203 Provide certificate data for the CA check.
204
205
206
207 redfish (optional, dict, None)
208 REDFISH protocol.
209
210
211 username (True, str, None)
212 Provide a username for the protocol.
213
214
215 password (True, str, None)
216 Provide a password for the protocol.
217
218
219 domain (optional, str, None)
220 Provide a domain for the protocol.
221
222
223 port (optional, int, 443)
224 Enter the port number that the job must use to discover the devices.
225
226
227 retries (optional, int, 3)
228 Enter the number of repeated attempts required to discover a device.
229
230
231 timeout (optional, int, 60)
232 Enter the time in seconds after which a job must stop running.
233
234
235 cn_check (optional, bool, False)
236 Enable the Common Name (CN) check.
237
238
239 ca_check (optional, bool, False)
240 Enable the Certificate Authority (CA) check.
241
242
243 certificate_data (optional, str, None)
244 Provide certificate data for the CA check.
245
246
247
248 snmp (optional, dict, None)
249 Simple Network Management Protocol (SNMP).
250
251
252 community (True, str, None)
253 Community string for the SNMP protocol.
254
255
256 port (optional, int, 161)
257 Enter the port number that the job must use to discover the devices.
258
259
260 retries (optional, int, 3)
261 Enter the number of repeated attempts required to discover a device.
262
263
264 timeout (optional, int, 3)
265 Enter the time in seconds after which a job must stop running.
266
267
268
269 storage (optional, dict, None)
270 HTTPS Storage protocol.
271
272
273 username (True, str, None)
274 Provide a username for the protocol.
275
276
277 password (True, str, None)
278 Provide a password for the protocol.
279
280
281 domain (optional, str, None)
282 Provide a domain for the protocol.
283
284
285 port (optional, int, 443)
286 Enter the port number that the job must use to discover the devices.
287
288
289 retries (optional, int, 3)
290 Enter the number of repeated attempts required to discover a device.
291
292
293 timeout (optional, int, 60)
294 Enter the time in seconds after which a job must stop running.
295
296
297 cn_check (optional, bool, False)
298 Enable the Common Name (CN) check.
299
300
301 ca_check (optional, bool, False)
302 Enable the Certificate Authority (CA) check.
303
304
305 certificate_data (optional, str, None)
306 Provide certificate data for the CA check.
307
308
309
310 vmware (optional, dict, None)
311 VMWARE protocol.
312
313
314 username (True, str, None)
315 Provide a username for the protocol.
316
317
318 password (True, str, None)
319 Provide a password for the protocol.
320
321
322 domain (optional, str, None)
323 Provide a domain for the protocol.
324
325
326 port (optional, int, 443)
327 Enter the port number that the job must use to discover the devices.
328
329
330 retries (optional, int, 3)
331 Enter the number of repeated attempts required to discover a device.
332
333
334 timeout (optional, int, 60)
335 Enter the time in seconds after which a job must stop running.
336
337
338 cn_check (optional, bool, False)
339 Enable the Common Name (CN) check.
340
341
342 ca_check (optional, bool, False)
343 Enable the Certificate Authority (CA) check.
344
345
346 certificate_data (optional, str, None)
347 Provide certificate data for the CA check.
348
349
350
351 ssh (optional, dict, None)
352 Secure Shell (SSH).
353
354
355 username (True, str, None)
356 Provide a username for the protocol.
357
358
359 password (True, str, None)
360 Provide a password for the protocol.
361
362
363 port (optional, int, 22)
364 Enter the port number that the job must use to discover the devices.
365
366
367 retries (optional, int, 3)
368 Enter the number of repeated attempts required to discover a device.
369
370
371 timeout (optional, int, 60)
372 Enter the time in seconds after which a job must stop running.
373
374
375 check_known_hosts (optional, bool, False)
376 Verify the known host key.
377
378
379 is_sudo_user (optional, bool, False)
380 Use the SUDO option.
381
382
383
384 ipmi (optional, dict, None)
385 Intelligent Platform Management Interface (IPMI)
386
387
388 username (True, str, None)
389 Provide a username for the protocol.
390
391
392 password (True, str, None)
393 Provide a password for the protocol.
394
395
396 retries (optional, int, 3)
397 Enter the number of repeated attempts required to discover a device.
398
399
400 timeout (optional, int, 60)
401 Enter the time in seconds after which a job must stop running.
402
403
404 kgkey (optional, str, None)
405 KgKey for the IPMI protocol.
406
407
408
409
410 hostname (True, str, None)
411 OpenManage Enterprise IP address or hostname.
412
413
414 username (False, str, None)
415 OpenManage Enterprise username.
416
417 If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used.
418
419 Example: export OME\_USERNAME=username
420
421
422 password (False, str, None)
423 OpenManage Enterprise password.
424
425 If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used.
426
427 Example: export OME\_PASSWORD=password
428
429
430 x_auth_token (False, str, None)
431 Authentication token.
432
433 If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used.
434
435 Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token
436
437
438 port (optional, int, 443)
439 OpenManage Enterprise HTTPS port.
440
441
442 validate_certs (optional, bool, True)
443 If \ :literal:`false`\ , the SSL certificates will not be validated.
444
445 Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used.
446
447 Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default.
448
449
450 ca_path (optional, path, None)
451 The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.
452
453
454 timeout (optional, int, 30)
455 The socket level timeout in seconds.
456
457
458
459
460
461 Notes
462 -----
463
464 .. note::
465 - Run this module from a system that has direct access to Dell OpenManage Enterprise.
466 - This module does not support \ :literal:`check\_mode`\ .
467 - If \ :emphasis:`state`\ is \ :literal:`present`\ , then Idempotency is not supported.
468
469
470
471
472 Examples
473 --------
474
475 .. code-block:: yaml+jinja
476
477
478 ---
479 - name: Discover servers in a range
480 dellemc.openmanage.ome_discovery:
481 hostname: "192.168.0.1"
482 username: "username"
483 password: "password"
484 ca_path: "/path/to/ca_cert.pem"
485 discovery_job_name: "Discovery_server_1"
486 discovery_config_targets:
487 - network_address_detail:
488 - 192.96.24.1-192.96.24.255
489 device_types:
490 - SERVER
491 wsman:
492 username: user
493 password: password
494
495 - name: Discover chassis in a range
496 dellemc.openmanage.ome_discovery:
497 hostname: "192.168.0.1"
498 username: "username"
499 password: "password"
500 ca_path: "/path/to/ca_cert.pem"
501 discovery_job_name: "Discovery_chassis_1"
502 discovery_config_targets:
503 - network_address_detail:
504 - 192.96.24.1-192.96.24.255
505 device_types:
506 - CHASSIS
507 wsman:
508 username: user
509 password: password
510
511 - name: Discover switches in a range
512 dellemc.openmanage.ome_discovery:
513 hostname: "192.168.0.1"
514 username: "username"
515 password: "password"
516 ca_path: "/path/to/ca_cert.pem"
517 discovery_job_name: "Discover_switch_1"
518 discovery_config_targets:
519 - network_address_detail:
520 - 192.96.24.1-192.96.24.255
521 device_types:
522 - NETWORK SWITCH
523 snmp:
524 community: snmp_creds
525
526 - name: Discover storage in a range
527 dellemc.openmanage.ome_discovery:
528 hostname: "192.168.0.1"
529 username: "username"
530 password: "password"
531 ca_path: "/path/to/ca_cert.pem"
532 discovery_job_name: "Discover_storage_1"
533 discovery_config_targets:
534 - network_address_detail:
535 - 192.96.24.1-192.96.24.255
536 device_types:
537 - STORAGE
538 storage:
539 username: user
540 password: password
541 snmp:
542 community: snmp_creds
543
544 - name: Delete a discovery job
545 dellemc.openmanage.ome_discovery:
546 hostname: "192.168.0.1"
547 username: "username"
548 password: "password"
549 ca_path: "/path/to/ca_cert.pem"
550 state: "absent"
551 discovery_job_name: "Discovery-123"
552
553 - name: Schedule the discovery of multiple devices ignoring partial failure and enable trap to receive alerts
554 dellemc.openmanage.ome_discovery:
555 hostname: "192.168.0.1"
556 username: "username"
557 password: "password"
558 ca_path: "/path/to/ca_cert.pem"
559 state: "present"
560 discovery_job_name: "Discovery-123"
561 discovery_config_targets:
562 - network_address_detail:
563 - 192.96.24.1-192.96.24.255
564 - 192.96.0.0/24
565 - 192.96.26.108
566 device_types:
567 - SERVER
568 - CHASSIS
569 - STORAGE
570 - NETWORK SWITCH
571 wsman:
572 username: wsman_user
573 password: wsman_pwd
574 redfish:
575 username: redfish_user
576 password: redfish_pwd
577 snmp:
578 community: snmp_community
579 - network_address_detail:
580 - 192.96.25.1-192.96.25.255
581 - ipmihost
582 - esxiserver
583 - sshserver
584 device_types:
585 - SERVER
586 ssh:
587 username: ssh_user
588 password: ssh_pwd
589 vmware:
590 username: vm_user
591 password: vmware_pwd
592 ipmi:
593 username: ipmi_user
594 password: ipmi_pwd
595 schedule: RunLater
596 cron: "0 0 9 ? * MON,WED,FRI *"
597 ignore_partial_failure: true
598 trap_destination: true
599 community_string: true
600 email_recipient: [email protected]
601
602 - name: Discover servers with ca check enabled
603 dellemc.openmanage.ome_discovery:
604 hostname: "192.168.0.1"
605 username: "username"
606 password: "password"
607 ca_path: "/path/to/ca_cert.pem"
608 discovery_job_name: "Discovery_server_ca1"
609 discovery_config_targets:
610 - network_address_detail:
611 - 192.96.24.108
612 device_types:
613 - SERVER
614 wsman:
615 username: user
616 password: password
617 ca_check: true
618 certificate_data: "{{ lookup('ansible.builtin.file', '/path/to/certificate_data_file') }}"
619
620 - name: Discover chassis with ca check enabled data
621 dellemc.openmanage.ome_discovery:
622 hostname: "192.168.0.1"
623 username: "username"
624 password: "password"
625 ca_path: "/path/to/ca_cert.pem"
626 discovery_job_name: "Discovery_chassis_ca1"
627 discovery_config_targets:
628 - network_address_detail:
629 - 192.96.24.108
630 device_types:
631 - CHASSIS
632 redfish:
633 username: user
634 password: password
635 ca_check: true
636 certificate_data: "-----BEGIN CERTIFICATE-----\r\n
637 ABCDEFGHIJKLMNOPQRSTUVWXYZaqwertyuiopasdfghjklzxcvbnmasdasagasvv\r\n
638 ABCDEFGHIJKLMNOPQRSTUVWXYZaqwertyuiopasdfghjklzxcvbnmasdasagasvv\r\n
639 ABCDEFGHIJKLMNOPQRSTUVWXYZaqwertyuiopasdfghjklzxcvbnmasdasagasvv\r\n
640 aqwertyuiopasdfghjklzxcvbnmasdasagasvv=\r\n
641 -----END CERTIFICATE-----"
642
643
644
645 Return Values
646 -------------
647
648 msg (always, str, Successfully deleted 1 discovery job(s).)
649 Overall status of the discovery operation.
650
651
652 discovery_status (when I(state) is C(present), dict, {'Completed': ['192.168.24.17', '192.168.24.20', '192.168.24.22'], 'Failed': ['192.168.24.15', '192.168.24.16', '192.168.24.18', '192.168.24.19', '192.168.24.21', 'host123'], 'DiscoveredDevicesByType': [{'Count': 3, 'DeviceType': 'SERVER'}], 'DiscoveryConfigDiscoveredDeviceCount': 3, 'DiscoveryConfigEmailRecipient': '[email protected]', 'DiscoveryConfigExpectedDeviceCount': 9, 'DiscoveryConfigGroupId': 125, 'JobDescription': 'D1', 'JobEnabled': True, 'JobEndTime': '2021-01-01 06:27:29.99', 'JobId': 12666, 'JobName': 'D1', 'JobNextRun': None, 'JobProgress': '100', 'JobSchedule': 'startnow', 'JobStartTime': '2021-01-01 06:24:10.071', 'JobStatusId': 2090, 'LastUpdateTime': '2021-01-01 06:27:30.001', 'UpdatedBy': 'admin'})
653 Details of the discovery job created or modified.
654
655 If \ :emphasis:`job\_wait`\ is true, Completed and Failed IPs are also listed.
656
657
658 discovery_ids (when discoveries with duplicate name exist for I(state) is C(present), list, [1234, 5678])
659 IDs of the discoveries with duplicate names.
660
661
662 job_detailed_status (All time., list, [{'ElapsedTime': '00:00:00', 'EndTime': None, 'ExecutionHistoryId': 564873, 'Id': 656893, 'IdBaseEntity': 0, 'JobStatus': {'Id': 2050, 'Name': 'Running'}, 'Key': '192.96.24.1', 'Progress': '0', 'StartTime': '2023-07-04 06:23:54.008', 'Value': 'Running\nDiscovery of target 192.96.24.1 started.\nDiscovery target resolved to IP 192.96.24.1 .'}])
663 Detailed last execution history of a job.
664
665
666 error_info (on HTTP error, dict, {'error': {'code': 'Base.1.0.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information.', '@Message.ExtendedInfo': [{'MessageId': 'GEN1234', 'RelatedProperties': [], 'Message': 'Unable to process the request because an error occurred.', 'MessageArgs': [], 'Severity': 'Critical', 'Resolution': 'Retry the operation. If the issue persists, contact your system administrator.'}]}})
667 Details of the HTTP Error.
668
669
670
671
672
673 Status
674 ------
675
676
677
678
679
680 Authors
681 ~~~~~~~
682
683 - Jagadeesh N V (@jagadeeshnv)
684 - Sajna Shetty (@Sajna-Shetty)
685 - Abhishek Sinha (@Abhishek-Dell)
686