summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/openmanage/plugins
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:22:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:22:15 +0000
commit0202b47f95a87598276869ab7f07f57e8a4c8a87 (patch)
tree21f101dcceb98166b117c40dab3d79d5b2ad8eed /ansible_collections/dellemc/openmanage/plugins
parentAdding upstream version 10.0.1+dfsg. (diff)
downloadansible-upstream.tar.xz
ansible-upstream.zip
Adding upstream version 10.1.0+dfsg.upstream/10.1.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/dellemc/openmanage/plugins')
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_auth_options.py4
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_x_auth_options.py69
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/doc_fragments/ome_auth_options.py20
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/doc_fragments/omem_auth_options.py20
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/doc_fragments/oment_auth_options.py20
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/doc_fragments/redfish_auth_options.py20
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/module_utils/idrac_redfish.py57
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/module_utils/ome.py49
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/module_utils/redfish.py48
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/module_utils/session_utils.py75
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_attributes.py15
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_boot.py18
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_certificates.py21
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_diagnostics.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_license.py21
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_network_attributes.py74
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_redfish_storage_controller.py10
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_reset.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_server_config_profile.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_session.py57
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_storage_volume.py32
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_user.py15
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_user_info.py15
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/idrac_virtual_media.py16
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_active_directory.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_actions_info.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_category_info.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_info.py15
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_message_id_info.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_smtp.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_syslog.py12
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_certificate.py31
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_console_preferences.py19
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_address.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_proxy.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_settings.py12
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_time.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_webserver.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_application_security_settings.py12
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_chassis_slots.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_baseline.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_info.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_device_group.py21
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_device_info.py14
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_device_local_access_configuration.py9
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_device_location.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_device_mgmt_network.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_device_network_services.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_device_power_settings.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_device_quick_deploy.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_devices.py9
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_diagnostics.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_discovery.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_domain_user_groups.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_compliance_info.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_info.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_catalog.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_groups.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_identity_pool.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_job_info.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_network_port_breakout.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan_info.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_powerstate.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_profile.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_profile_info.py16
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profile_info.py18
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profiles.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_session.py408
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_info.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink_info.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_template.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_template_identity_pool.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_template_info.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan_info.py14
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_user.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/ome_user_info.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/redfish_event_subscription.py12
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware.py14
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware_rollback.py11
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/redfish_powerstate.py13
-rw-r--r--ansible_collections/dellemc/openmanage/plugins/modules/redfish_storage_volume.py10
88 files changed, 1312 insertions, 640 deletions
diff --git a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_auth_options.py b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_auth_options.py
index cdad6d1b8..49eebcd2e 100644
--- a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_auth_options.py
+++ b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_auth_options.py
@@ -26,14 +26,14 @@ options:
type: str
description:
- iDRAC username.
- - If the username is not provided, then the environment variable C(IDRAC_USERNAME) is used.
+ - If the username is not provided, then the environment variable E(IDRAC_USERNAME) is used.
- "Example: export IDRAC_USERNAME=username"
idrac_password:
required: true
type: str
description:
- iDRAC user password.
- - If the password is not provided, then the environment variable C(IDRAC_PASSWORD) is used.
+ - If the password is not provided, then the environment variable E(IDRAC_PASSWORD) is used.
- "Example: export IDRAC_PASSWORD=password"
aliases: ['idrac_pwd']
idrac_port:
diff --git a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_x_auth_options.py b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_x_auth_options.py
new file mode 100644
index 000000000..4df58680e
--- /dev/null
+++ b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/idrac_x_auth_options.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+
+#
+# Dell OpenManage Ansible Modules
+# Version 9.3.0
+# Copyright (C) 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
+
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+#
+
+
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
+
+class ModuleDocFragment(object):
+
+ DOCUMENTATION = r'''
+options:
+ idrac_ip:
+ required: true
+ type: str
+ description: iDRAC IP Address.
+ idrac_user:
+ required: false
+ type: str
+ description:
+ - iDRAC username.
+ - If the username is not provided, then the environment variable E(IDRAC_USERNAME) is used.
+ - "Example: export IDRAC_USERNAME=username"
+ idrac_password:
+ required: false
+ type: str
+ description:
+ - iDRAC user password.
+ - If the password is not provided, then the environment variable E(IDRAC_PASSWORD) is used.
+ - "Example: export IDRAC_PASSWORD=password"
+ aliases: ['idrac_pwd']
+ x_auth_token:
+ description:
+ - Authentication token.
+ - If the x_auth_token is not provided, then the environment variable E(IDRAC_X_AUTH_TOKEN) is used.
+ - "Example: export IDRAC_X_AUTH_TOKEN=x_auth_token"
+ type: str
+ required: false
+ version_added: 9.3.0
+ idrac_port:
+ type: int
+ description: iDRAC port.
+ default: 443
+ validate_certs:
+ description:
+ - If C(false), the SSL certificates will not be validated.
+ - Configure C(false) only on personally controlled sites where self-signed certificates are used.
+ - Prior to collection version C(5.0.0), the I(validate_certs) is C(false) by default.
+ type: bool
+ default: true
+ version_added: 5.0.0
+ ca_path:
+ description:
+ - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.
+ type: path
+ version_added: 5.0.0
+ timeout:
+ description: The socket level timeout in seconds.
+ type: int
+ default: 30
+ version_added: 5.0.0
+'''
diff --git a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/ome_auth_options.py b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/ome_auth_options.py
index 7627a6621..28e68f7cb 100644
--- a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/ome_auth_options.py
+++ b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/ome_auth_options.py
@@ -2,8 +2,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -24,17 +24,25 @@ options:
username:
description:
- OpenManage Enterprise or OpenManage Enterprise Modular username.
- - If the username is not provided, then the environment variable C(OME_USERNAME) is used.
+ - If the username is not provided, then the environment variable E(OME_USERNAME) is used.
- "Example: export OME_USERNAME=username"
type: str
- required: true
+ required: false
password:
description:
- OpenManage Enterprise or OpenManage Enterprise Modular password.
- - If the password is not provided, then the environment variable C(OME_PASSWORD) is used.
+ - If the password is not provided, then the environment variable E(OME_PASSWORD) is used.
- "Example: export OME_PASSWORD=password"
type: str
- required: true
+ required: false
+ x_auth_token:
+ description:
+ - Authentication token.
+ - If the x_auth_token is not provided, then the environment variable E(OME_X_AUTH_TOKEN) is used.
+ - "Example: export OME_X_AUTH_TOKEN=x_auth_token"
+ type: str
+ required: false
+ version_added: 9.3.0
port:
description: OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port.
type: int
diff --git a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/omem_auth_options.py b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/omem_auth_options.py
index e611e02df..8a7b4f8d9 100644
--- a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/omem_auth_options.py
+++ b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/omem_auth_options.py
@@ -2,8 +2,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -24,17 +24,25 @@ options:
username:
description:
- OpenManage Enterprise Modular username.
- - If the username is not provided, then the environment variable C(OME_USERNAME) is used.
+ - If the username is not provided, then the environment variable E(OME_USERNAME) is used.
- "Example: export OME_USERNAME=username"
type: str
- required: true
+ required: false
password:
description:
- OpenManage Enterprise Modular password.
- - If the password is not provided, then the environment variable C(OME_PASSWORD) is used.
+ - If the password is not provided, then the environment variable E(OME_PASSWORD) is used.
- "Example: export OME_PASSWORD=password"
type: str
- required: true
+ required: false
+ x_auth_token:
+ description:
+ - Authentication token.
+ - If the x_auth_token is not provided, then the environment variable E(OME_X_AUTH_TOKEN) is used.
+ - "Example: export OME_X_AUTH_TOKEN=x_auth_token"
+ type: str
+ required: false
+ version_added: 9.3.0
port:
description: OpenManage Enterprise Modular HTTPS port.
type: int
diff --git a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/oment_auth_options.py b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/oment_auth_options.py
index 676ded435..9430cb9a6 100644
--- a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/oment_auth_options.py
+++ b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/oment_auth_options.py
@@ -2,8 +2,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -24,17 +24,25 @@ options:
username:
description:
- OpenManage Enterprise username.
- - If the username is not provided, then the environment variable C(OME_USERNAME) is used.
+ - If the username is not provided, then the environment variable E(OME_USERNAME) is used.
- "Example: export OME_USERNAME=username"
type: str
- required: true
+ required: false
password:
description:
- OpenManage Enterprise password.
- - If the password is not provided, then the environment variable C(OME_PASSWORD) is used.
+ - If the password is not provided, then the environment variable E(OME_PASSWORD) is used.
- "Example: export OME_PASSWORD=password"
type: str
- required: true
+ required: false
+ x_auth_token:
+ description:
+ - Authentication token.
+ - If the x_auth_token is not provided, then the environment variable E(OME_X_AUTH_TOKEN) is used.
+ - "Example: export OME_X_AUTH_TOKEN=x_auth_token"
+ type: str
+ required: false
+ version_added: 9.3.0
port:
description: OpenManage Enterprise HTTPS port.
type: int
diff --git a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/redfish_auth_options.py b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/redfish_auth_options.py
index 452bc8a2d..7e15aef25 100644
--- a/ansible_collections/dellemc/openmanage/plugins/doc_fragments/redfish_auth_options.py
+++ b/ansible_collections/dellemc/openmanage/plugins/doc_fragments/redfish_auth_options.py
@@ -2,8 +2,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -24,17 +24,25 @@ options:
username:
description:
- Username of the target out-of-band controller.
- - If the username is not provided, then the environment variable C(IDRAC_USERNAME) is used.
+ - If the username is not provided, then the environment variable E(IDRAC_USERNAME) is used.
- "Example: export IDRAC_USERNAME=username"
type: str
- required: true
+ required: false
password:
description:
- Password of the target out-of-band controller.
- - If the password is not provided, then the environment variable C(IDRAC_PASSWORD) is used.
+ - If the password is not provided, then the environment variable E(IDRAC_PASSWORD) is used.
- "Example: export IDRAC_PASSWORD=password"
type: str
- required: true
+ required: false
+ x_auth_token:
+ description:
+ - Authentication token.
+ - If the x_auth_token is not provided, then the environment variable E(IDRAC_X_AUTH_TOKEN) is used.
+ - "Example: export IDRAC_X_AUTH_TOKEN=x_auth_token"
+ type: str
+ required: false
+ version_added: 9.3.0
validate_certs:
description:
- If C(false), the SSL certificates will not be validated.
diff --git a/ansible_collections/dellemc/openmanage/plugins/module_utils/idrac_redfish.py b/ansible_collections/dellemc/openmanage/plugins/module_utils/idrac_redfish.py
index cf4581e89..7e55364a1 100644
--- a/ansible_collections/dellemc/openmanage/plugins/module_utils/idrac_redfish.py
+++ b/ansible_collections/dellemc/openmanage/plugins/module_utils/idrac_redfish.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# Dell OpenManage Ansible Modules
-# Version 8.0.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@@ -38,6 +38,7 @@ from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible.module_utils.common.parameters import env_fallback
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import config_ipv6
+from ansible.module_utils.basic import AnsibleModule
idrac_auth_params = {
"idrac_ip": {"required": True, "type": 'str'},
@@ -101,6 +102,7 @@ class iDRACRedfishAPI(object):
self.ipaddress = module_params['idrac_ip']
self.username = module_params['idrac_user']
self.password = module_params['idrac_password']
+ self.x_auth_token = module_params.get('x_auth_token')
self.port = module_params['idrac_port']
self.validate_certs = module_params.get("validate_certs", False)
self.ca_path = module_params.get("ca_path")
@@ -180,7 +182,7 @@ class iDRACRedfishAPI(object):
def __enter__(self):
"""Creates sessions by passing it to header"""
- if self.req_session:
+ if self.req_session and not self.x_auth_token:
payload = {'UserName': self.username,
'Password': self.password}
path = SESSION_RESOURCE_COLLECTION["SESSION"]
@@ -191,6 +193,8 @@ class iDRACRedfishAPI(object):
else:
msg = "Could not create the session"
raise ConnectionError(msg)
+ elif self.x_auth_token is not None:
+ self._headers["X-Auth-Token"] = self.x_auth_token
return self
def __exit__(self, exc_type, exc_value, traceback):
@@ -300,7 +304,7 @@ class iDRACRedfishAPI(object):
return response
def import_scp_share(self, shutdown_type=None, host_powerstate=None, job_wait=True,
- target=None, import_buffer=None, share=None):
+ target=None, import_buffer=None, share=None, time_to_wait=300):
"""
This method imports system configuration using share.
:param shutdown_type: graceful
@@ -312,7 +316,7 @@ class iDRACRedfishAPI(object):
:return: json response
"""
payload = {"ShutdownType": shutdown_type, "EndHostPowerState": host_powerstate,
- "ShareParameters": {"Target": target}}
+ "ShareParameters": {"Target": target}, "TimeToWait": time_to_wait}
if import_buffer is not None:
payload["ImportBuffer"] = import_buffer
if share is None:
@@ -384,7 +388,7 @@ class iDRACRedfishAPI(object):
response = self.wait_for_job_complete(task_uri, job_wait=job_wait)
return response
- def import_scp(self, import_buffer=None, target=None, job_wait=False):
+ def import_scp(self, import_buffer=None, target=None, job_wait=False, time_to_wait=300):
"""
This method imports system configuration details to the system.
:param import_buffer: import buffer payload content xml or json format
@@ -392,7 +396,7 @@ class iDRACRedfishAPI(object):
:param job_wait: True or False decide whether to wait till the job completion.
:return: json response
"""
- payload = {"ImportBuffer": import_buffer, "ShareParameters": {"Target": target}}
+ payload = {"ImportBuffer": import_buffer, "ShareParameters": {"Target": target}, "TimeToWait": time_to_wait}
response = self.invoke_request(IMPORT_URI, "POST", data=payload)
if response.status_code == 202 and job_wait:
task_uri = response.headers["Location"]
@@ -433,3 +437,42 @@ class iDRACRedfishAPI(object):
def _get_omam_ca_env(self):
"""Check if the value is set in REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE or OMAM_CA_BUNDLE or returns None"""
return os.environ.get("REQUESTS_CA_BUNDLE") or os.environ.get("CURL_CA_BUNDLE") or os.environ.get("OMAM_CA_BUNDLE")
+
+
+class IdracAnsibleModule(AnsibleModule):
+ def __init__(self, argument_spec, bypass_checks=False, no_log=False,
+ mutually_exclusive=None, required_together=None,
+ required_one_of=None, add_file_common_args=False,
+ supports_check_mode=False, required_if=None, required_by=None):
+ idrac_argument_spec = {
+ "idrac_ip": {"required": True, "type": 'str'},
+ "idrac_user": {"required": False, "type": 'str', "fallback": (env_fallback, ['IDRAC_USERNAME'])},
+ "idrac_password": {"required": False, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True, "fallback": (env_fallback, ['IDRAC_PASSWORD'])},
+ "x_auth_token": {"required": False, "type": 'str', "no_log": True, "fallback": (env_fallback, ['IDRAC_X_AUTH_TOKEN'])},
+ "idrac_port": {"required": False, "default": 443, "type": 'int'},
+ "validate_certs": {"type": "bool", "default": True},
+ "ca_path": {"type": "path"},
+ "timeout": {"type": "int", "default": 30},
+ }
+ argument_spec.update(idrac_argument_spec)
+
+ auth_mutually_exclusive = [("idrac_user", "x_auth_token"), ("idrac_password", "x_auth_token")]
+ auth_required_one_of = [("idrac_user", "x_auth_token")]
+ auth_required_together = [("idrac_user", "idrac_password")]
+
+ if mutually_exclusive is None:
+ mutually_exclusive = []
+ mutually_exclusive.extend(auth_mutually_exclusive)
+ if required_together is None:
+ required_together = []
+ required_together.extend(auth_required_together)
+ if required_one_of is None:
+ required_one_of = []
+ required_one_of.extend(auth_required_one_of)
+ if required_by is None:
+ required_by = {}
+
+ super().__init__(argument_spec, bypass_checks, no_log,
+ mutually_exclusive, required_together,
+ required_one_of, add_file_common_args,
+ supports_check_mode, required_if, required_by)
diff --git a/ansible_collections/dellemc/openmanage/plugins/module_utils/ome.py b/ansible_collections/dellemc/openmanage/plugins/module_utils/ome.py
index cd0bb6be0..4aeba6201 100644
--- a/ansible_collections/dellemc/openmanage/plugins/module_utils/ome.py
+++ b/ansible_collections/dellemc/openmanage/plugins/module_utils/ome.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@@ -38,6 +38,7 @@ from ansible.module_utils.common.parameters import env_fallback
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import config_ipv6
+from ansible.module_utils.basic import AnsibleModule
ome_auth_params = {
"hostname": {"required": True, "type": "str"},
@@ -96,6 +97,7 @@ class RestOME(object):
self.hostname = str(self.module_params["hostname"]).strip('][')
self.username = self.module_params["username"]
self.password = self.module_params["password"]
+ self.x_auth_token = self.module_params.get("x_auth_token")
self.port = self.module_params["port"]
self.validate_certs = self.module_params.get("validate_certs", True)
self.ca_path = self.module_params.get("ca_path")
@@ -191,7 +193,7 @@ class RestOME(object):
def __enter__(self):
"""Creates sessions by passing it to header"""
- if self.req_session:
+ if self.req_session and not self.x_auth_token:
payload = {'UserName': self.username,
'Password': self.password,
'SessionType': 'API', }
@@ -203,6 +205,8 @@ class RestOME(object):
else:
msg = "Could not create the session"
raise ConnectionError(msg)
+ elif self.x_auth_token is not None:
+ self._headers["X-Auth-Token"] = self.x_auth_token
return self
def __exit__(self, exc_type, exc_value, traceback):
@@ -401,3 +405,42 @@ class RestOME(object):
def _get_omam_ca_env(self):
"""Check if the value is set in REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE or OMAM_CA_BUNDLE or returns None"""
return os.environ.get("REQUESTS_CA_BUNDLE") or os.environ.get("CURL_CA_BUNDLE") or os.environ.get("OMAM_CA_BUNDLE")
+
+
+class OmeAnsibleModule(AnsibleModule):
+ def __init__(self, argument_spec, bypass_checks=False, no_log=False,
+ mutually_exclusive=None, required_together=None,
+ required_one_of=None, add_file_common_args=False,
+ supports_check_mode=False, required_if=None, required_by=None):
+ ome_argument_spec = {
+ "hostname": {"required": True, "type": "str"},
+ "username": {"required": False, "type": "str", "fallback": (env_fallback, ['OME_USERNAME'])},
+ "password": {"required": False, "type": "str", "no_log": True, "fallback": (env_fallback, ['OME_PASSWORD'])},
+ "x_auth_token": {"required": False, "type": "str", "no_log": True, "fallback": (env_fallback, ['OME_X_AUTH_TOKEN'])},
+ "port": {"type": "int", "default": 443},
+ "validate_certs": {"type": "bool", "default": True},
+ "ca_path": {"type": "path"},
+ "timeout": {"type": "int", "default": 30},
+ }
+ argument_spec.update(ome_argument_spec)
+
+ auth_mutually_exclusive = [("username", "x_auth_token"), ("password", "x_auth_token")]
+ auth_required_one_of = [("username", "x_auth_token")]
+ auth_required_together = [("username", "password")]
+
+ if mutually_exclusive is None:
+ mutually_exclusive = []
+ mutually_exclusive.extend(auth_mutually_exclusive)
+ if required_together is None:
+ required_together = []
+ required_together.extend(auth_required_together)
+ if required_one_of is None:
+ required_one_of = []
+ required_one_of.extend(auth_required_one_of)
+ if required_by is None:
+ required_by = {}
+
+ super().__init__(argument_spec, bypass_checks, no_log,
+ mutually_exclusive, required_together,
+ required_one_of, add_file_common_args,
+ supports_check_mode, required_if, required_by)
diff --git a/ansible_collections/dellemc/openmanage/plugins/module_utils/redfish.py b/ansible_collections/dellemc/openmanage/plugins/module_utils/redfish.py
index 8a26eaf60..7e1615ab4 100644
--- a/ansible_collections/dellemc/openmanage/plugins/module_utils/redfish.py
+++ b/ansible_collections/dellemc/openmanage/plugins/module_utils/redfish.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@@ -36,6 +36,7 @@ from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible.module_utils.common.parameters import env_fallback
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import config_ipv6
+from ansible.module_utils.basic import AnsibleModule
redfish_auth_params = {
"baseuri": {"required": True, "type": "str"},
@@ -96,6 +97,7 @@ class Redfish(object):
self.hostname = self.module_params["baseuri"]
self.username = self.module_params["username"]
self.password = self.module_params["password"]
+ self.x_auth_token = self.module_params.get("x_auth_token")
self.validate_certs = self.module_params.get("validate_certs", True)
self.ca_path = self.module_params.get("ca_path")
self.timeout = self.module_params.get("timeout", 30)
@@ -191,7 +193,7 @@ class Redfish(object):
def __enter__(self):
"""Creates sessions by passing it to header"""
- if self.req_session:
+ if self.req_session and not self.x_auth_token:
payload = {'UserName': self.username,
'Password': self.password}
path = SESSION_RESOURCE_COLLECTION["SESSION"]
@@ -202,6 +204,8 @@ class Redfish(object):
else:
msg = "Could not create the session"
raise ConnectionError(msg)
+ elif self.x_auth_token is not None:
+ self._headers["X-Auth-Token"] = self.x_auth_token
return self
def __exit__(self, exc_type, exc_value, traceback):
@@ -222,3 +226,41 @@ class Redfish(object):
def _get_omam_ca_env(self):
"""Check if the value is set in REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE or OMAM_CA_BUNDLE or returns None"""
return os.environ.get("REQUESTS_CA_BUNDLE") or os.environ.get("CURL_CA_BUNDLE") or os.environ.get("OMAM_CA_BUNDLE")
+
+
+class RedfishAnsibleModule(AnsibleModule):
+ def __init__(self, argument_spec, bypass_checks=False, no_log=False,
+ mutually_exclusive=None, required_together=None,
+ required_one_of=None, add_file_common_args=False,
+ supports_check_mode=False, required_if=None, required_by=None):
+ redfish_argument_spec = {
+ "baseuri": {"required": True, "type": "str"},
+ "username": {"required": False, "type": "str", "fallback": (env_fallback, ['IDRAC_USERNAME'])},
+ "password": {"required": False, "type": "str", "no_log": True, "fallback": (env_fallback, ['IDRAC_PASSWORD'])},
+ "x_auth_token": {"required": False, "type": "str", "no_log": True, "fallback": (env_fallback, ['IDRAC_X_AUTH_TOKEN'])},
+ "validate_certs": {"type": "bool", "default": True},
+ "ca_path": {"type": "path"},
+ "timeout": {"type": "int", "default": 30},
+ }
+ argument_spec.update(redfish_argument_spec)
+
+ auth_mutually_exclusive = [("username", "x_auth_token"), ("password", "x_auth_token")]
+ auth_required_one_of = [("username", "x_auth_token")]
+ auth_required_together = [("username", "password")]
+
+ if mutually_exclusive is None:
+ mutually_exclusive = []
+ mutually_exclusive.extend(auth_mutually_exclusive)
+ if required_together is None:
+ required_together = []
+ required_together.extend(auth_required_together)
+ if required_one_of is None:
+ required_one_of = []
+ required_one_of.extend(auth_required_one_of)
+ if required_by is None:
+ required_by = {}
+
+ super().__init__(argument_spec, bypass_checks, no_log,
+ mutually_exclusive, required_together,
+ required_one_of, add_file_common_args,
+ supports_check_mode, required_if, required_by)
diff --git a/ansible_collections/dellemc/openmanage/plugins/module_utils/session_utils.py b/ansible_collections/dellemc/openmanage/plugins/module_utils/session_utils.py
index 4bead057a..54728a771 100644
--- a/ansible_collections/dellemc/openmanage/plugins/module_utils/session_utils.py
+++ b/ansible_collections/dellemc/openmanage/plugins/module_utils/session_utils.py
@@ -34,6 +34,8 @@ import os
from ansible.module_utils.urls import open_url
from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import config_ipv6
+from ansible.module_utils.urls import open_url
+from abc import ABC, abstractmethod
HEADER_TYPE = "application/json"
@@ -177,7 +179,7 @@ class SessionAPI():
self._headers = {
'Content-Type': HEADER_TYPE,
'Accept': HEADER_TYPE,
- 'X-Auth-Token': module_params.get("auth_token")
+ 'X-Auth-Token': module_params.get("x_auth_token")
}
def _get_url(self, uri):
@@ -220,7 +222,7 @@ class SessionAPI():
url += f"?{urlencode(query_param)}"
return url
- def _url_common_args_spec(self, method, api_timeout, headers=None):
+ def _url_common_args_spec(self, method, api_timeout, headers=None, url_kwargs=None):
"""
Generates the common arguments for a URL request.
@@ -242,25 +244,27 @@ class SessionAPI():
- follow_redirects (str): The policy for following redirects.
"""
- req_header = self._headers
- if headers:
- req_header.update(headers)
if api_timeout is None:
api_timeout = self.timeout
if self.ca_path is None:
self.ca_path = self._get_omam_ca_env()
- url_kwargs = {
+ req_header = self._headers
+ if headers:
+ req_header.update(headers)
+ url_params = {
"method": method,
"validate_certs": self.validate_certs,
"ca_path": self.ca_path,
"use_proxy": self.use_proxy,
"headers": req_header,
"timeout": api_timeout,
- "follow_redirects": 'all',
+ "follow_redirects": 'all'
}
- return url_kwargs
+ if url_kwargs:
+ url_params.update(url_kwargs)
+ return url_params
- def _args_session(self, method, api_timeout, headers=None):
+ def _args_session(self, method, api_timeout, headers=None, url_kwargs=None):
"""
Returns a dictionary containing the arguments needed to establish a session.
@@ -275,11 +279,11 @@ class SessionAPI():
req_header = self._headers
if headers:
req_header.update(headers)
- url_kwargs = self._url_common_args_spec(method, api_timeout, headers=headers)
+ url_kwargs = self._url_common_args_spec(method, api_timeout, headers=headers, url_kwargs=url_kwargs)
return url_kwargs
def invoke_request(self, uri, method, data=None, query_param=None, headers=None,
- api_timeout=None, dump=True):
+ api_timeout=None, dump=True, url_kwargs=None):
"""
Invokes a request to the specified URI using the given method and optional parameters.
@@ -300,7 +304,7 @@ class SessionAPI():
:return: The response data from the request.
:rtype: OpenURLResponse
"""
- url_kwargs = self._args_session(method, api_timeout, headers=headers)
+ url_kwargs = self._args_session(method, api_timeout, headers=headers, url_kwargs=url_kwargs)
if data and dump:
data = json.dumps(data)
url = self._build_url(uri, query_param=query_param)
@@ -320,3 +324,50 @@ class SessionAPI():
return (os.environ.get("REQUESTS_CA_BUNDLE") or
os.environ.get("CURL_CA_BUNDLE") or
os.environ.get("OMAM_CA_BUNDLE"))
+
+
+class Session(ABC):
+ """
+ Parent class for all session operations.
+ """
+ def __init__(self, module):
+ """
+ Initializes the object with the given instance and module parameters.
+
+ Args:
+ instance (object): The ome object.
+ module (object): The module object.
+
+ Returns:
+ None
+ """
+ self.instance = SessionAPI(module.params)
+ self.module = module
+
+ @abstractmethod
+ def create_session(self):
+ """
+ Abstract method to create a session.
+ Must be implemented by subclasses.
+
+ Args:
+ None
+
+ Returns:
+ None
+ """
+ pass
+
+ @abstractmethod
+ def delete_session(self):
+ """
+ Abstract method to delete a session.
+ Must be implemented by subclasses.
+
+ Args:
+ None
+
+ Returns:
+ None
+ """
+ pass
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_attributes.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_attributes.py
index 1b61b3ebe..2dd0d4bf9 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_attributes.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_attributes.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.1.0
-# Copyright (C) 2022-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -22,7 +22,7 @@ version_added: "6.0.0"
description:
- This module allows to configure the iDRAC attributes.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
idrac_attributes:
type: dict
@@ -62,7 +62,7 @@ options:
type: str
description: Redfish ID of the resource.
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- Husniya Abdul Hameed (@husniya-hameed)
- Felix Stephen (@felixs88)
@@ -262,9 +262,8 @@ import json
import re
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import get_manager_res_id
-from ansible.module_utils.basic import AnsibleModule
SUCCESS_MSG = "Successfully updated the attributes."
@@ -496,8 +495,8 @@ def main():
"lifecycle_controller_attributes": {"required": False, "type": 'dict'},
"resource_id": {"required": False, "type": 'str'}
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
required_one_of=[('idrac_attributes', 'system_attributes', 'lifecycle_controller_attributes')],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_boot.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_boot.py
index 1e28ef30d..a02e7498e 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_boot.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_boot.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.0.0
-# Copyright (C) 2022-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -21,7 +21,7 @@ version_added: "6.1.0"
description:
- This module allows to configure the boot order settings.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
boot_options:
type: list
@@ -121,7 +121,7 @@ options:
type: str
description: Redfish ID of the resource.
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Felix Stephen (@felixs88)"
notes:
@@ -264,11 +264,11 @@ import json
import time
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import (strip_substr_dict, idrac_system_reset,
get_system_res_id,
wait_for_idrac_job_completion)
-from ansible.module_utils.basic import AnsibleModule
+
SYSTEM_URI = "/redfish/v1/Systems"
BOOT_OPTIONS_URI = "/redfish/v1/Systems/{0}/BootOptions?$expand=*($levels=1)"
@@ -286,7 +286,7 @@ INVALID_BOOT_OPT = "{0} boot order reference provided."
SUCCESS_MSG = "Successfully updated the boot settings."
FAILED_MSG = "Failed to update the boot settings."
UNSUPPORTED_MSG = "The system does not support the BootOptions feature."
-JOB_WAIT_MSG = "The boot settings job is triggered successfully."
+JOB_WAIT_MSG = "The boot settings operation is triggered/submitted successfully."
AUTH_ERROR_MSG = "Unable to communicate with iDRAC {0}. This may be due to one of the following: " \
"Incorrect username or password, unreachable iDRAC IP or a failure in TLS/SSL handshake."
@@ -512,8 +512,8 @@ def main():
"job_wait_timeout": {"required": False, "type": "int", "default": 900},
"resource_id": {"required": False, "type": "str"}
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
required_one_of=[["boot_options", "boot_order", "boot_source_override_mode",
"boot_source_override_enabled", "boot_source_override_target",
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_certificates.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_certificates.py
index a429c639b..274bcf898 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_certificates.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_certificates.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.6.0
-# Copyright (C) 2022-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -22,7 +22,7 @@ version_added: "5.5.0"
description:
- This module allows to generate certificate signing request, import, and export certificates on iDRAC.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
command:
description:
@@ -113,7 +113,7 @@ options:
type: int
default: 300
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V(@jagadeeshnv)"
- "Rajshekar P(@rajshekarp87)"
@@ -248,8 +248,7 @@ import json
import base64
import os
from datetime import datetime
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import reset_idrac
@@ -383,7 +382,11 @@ def _build_generate_csr_payload(module, cert_type):
for key, value in csr_transform.items():
if cert_params.get(key) is not None:
- payload[value] = cert_params.get(key)
+ if value == 'AlternativeNames':
+ forming_string = ",".join(cert_params.get(key))
+ payload[value] = [forming_string]
+ else:
+ payload[value] = cert_params.get(key)
if rfish_cert_coll.get(cert_type):
payload["CertificateCollection"] = rfish_cert_coll.get(cert_type)
@@ -564,8 +567,8 @@ def main():
"reset": {"type": 'bool', "default": True},
"wait": {"type": 'int', "default": 300}
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
required_if=[
['command', 'generate_csr', ('cert_params', 'certificate_path',)],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_diagnostics.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_diagnostics.py
index 3df5a68fd..e19c0107b 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_diagnostics.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_diagnostics.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.0.0
+# Version 9.3.0
# Copyright (C) 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -22,7 +22,7 @@ version_added: "9.0.0"
description:
- This module allows you to run and export diagnostics on iDRAC.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
run:
description:
@@ -344,8 +344,7 @@ error_info:
import json
import os
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import (
@@ -768,8 +767,8 @@ class DiagnosticsType:
def main():
specs = get_argument_spec()
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
required_one_of=[["run", "export"]],
required_if=[
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_license.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_license.py
index 565c61cd4..1bf0e2b3c 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_license.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_license.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.7.0
+# Version 9.3.0
# Copyright (C) 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -22,7 +22,7 @@ version_added: "8.7.0"
description:
- This module allows to import, export and delete licenses on iDRAC.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
license_id:
description:
@@ -390,8 +390,7 @@ import json
import os
import base64
from urllib.error import HTTPError, URLError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
-from ansible.module_utils.basic import AnsibleModule
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.compat.version import LooseVersion
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import (
@@ -634,15 +633,15 @@ class ExportLicense(License):
self.module.exit_json(msg=INSUFFICIENT_DIRECTORY_PERMISSION_MSG.format(path=path), failed=True)
license_name = self.module.params.get('share_parameters').get('file_name')
if license_name:
- license_file_name = f"{license_name}_iDRAC_license.txt"
+ license_file_name = f"{license_name}"
else:
- license_file_name = f"{self.module.params['license_id']}_iDRAC_license.txt"
+ license_file_name = f"{self.module.params['license_id']}_iDRAC_license.xml"
license_status = self.idrac.invoke_request(export_license_url, "POST", data=payload)
license_data = license_status.json_data
- license_file = license_data.get("LicenseFile")
+ license_file = base64.b64decode(license_data.get("LicenseFile")).decode('utf-8')
file_name = os.path.join(path, license_file_name)
with open(file_name, "w") as fp:
- fp.writelines(license_file)
+ fp.write(license_file)
return license_status
def __export_license_http(self, export_license_url):
@@ -737,7 +736,7 @@ class ExportLicense(License):
"""
license_name = self.module.params.get('share_parameters').get('file_name')
if license_name:
- license_file_name = f"{license_name}_iDRAC_license.xml"
+ license_file_name = f"{license_name}"
else:
license_file_name = f"{self.module.params['license_id']}_iDRAC_license.xml"
payload["FileName"] = license_file_name
@@ -999,8 +998,8 @@ def main():
None
"""
specs = get_argument_spec()
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
mutually_exclusive=[("import", "export", "delete")],
required_if=[
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_network_attributes.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_network_attributes.py
index 0103570be..dbaa9b4f2 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_network_attributes.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_network_attributes.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.4.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -22,7 +22,7 @@ version_added: "8.4.0"
description:
- This module allows you to configure the port and partition network attributes on the network interface cards.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
network_adapter_id:
type: str
@@ -40,17 +40,17 @@ options:
type: dict
description:
- "Dictionary of network attributes and value. To view the list of attributes and its structure, see the below API
- U(https://I(idrac_ip)/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/<network_id>/NetworkDeviceFunctions/
- <network_port_id>/Settings) and U(https://<idrac_ip>/redfish/v1/Schemas/NetworkDeviceFunction.v1_8_0.json)."
+ U(https://I(idrac_ip)/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/<network_adapter_id>/NetworkDeviceFunctions/
+ <network_device_function_id>/Settings) and U(https://<idrac_ip>/redfish/v1/Schemas/NetworkDeviceFunction.v1_8_0.json)."
- I(network_attributes) is mutually exclusive with I(oem_network_attributes).
oem_network_attributes:
type: dict
description:
- "The attributes must be part of the Integrated Dell Remote Access Controller Attribute Registry.
To view the list of attributes in Attribute Registry for iDRAC9 and newer versions. For more information,
- see, U(https://I(idrac_ip)/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters/<network_id>/NetworkDeviceFunctions/
- <network_port_id>/Oem/Dell/DellNetworkAttributes/<network_port_id>)
- and U(https://I(idrac_ip)/redfish/v1/Registries/NetworkAttributesRegistry_<network_port_id>/
+ see, U(https://I(idrac_ip)/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters/<network_adapter_id>/NetworkDeviceFunctions/
+ <network_device_function_id>/Oem/Dell/DellNetworkAttributes/<network_device_function_id>)
+ and U(https://I(idrac_ip)/redfish/v1/Registries/NetworkAttributesRegistry_<network_device_function_id>/
NetworkAttributesRegistry_network_port_id.json)."
- For iDRAC8 based servers, derive the network attribute name from Server Configuration Profile.
- I(oem_network_attributes) is mutually exclusive with I(network_attributes).
@@ -131,8 +131,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: "NIC.Integrated.1"
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: "NIC.Integrated.1"
+ network_device_function_id: "NIC.Integrated.1-1-1"
apply_time: "Immediate"
oem_network_attributes:
BannerMessageTimeout: "4"
@@ -142,8 +142,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
oem_network_attributes:
BannerMessageTimeout: "4"
apply_time: OnReset
@@ -153,8 +153,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
oem_network_attributes:
BannerMessageTimeout: "4"
apply_time: AtMaintenanceWindowStart
@@ -167,8 +167,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
apply_time: "Immediate"
clear_pending: true
@@ -177,8 +177,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
apply_time: "Immediate"
clear_pending: true
oem_network_attributes:
@@ -189,8 +189,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
apply_time: "Immediate"
oem_network_attributes:
LnkSpeed: "10MbpsHalf"
@@ -204,8 +204,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
apply_time: OnReset
network_attributes:
Ethernet:
@@ -217,8 +217,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
network_attributes:
Ethernet:
VLAN:
@@ -230,8 +230,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
network_attributes:
iSCSIBoot:
InitiatorIPAddress: 1.0.0.1
@@ -245,8 +245,8 @@ EXAMPLES = """
idrac_ip: "192.168.0.1"
idrac_user: "user_name"
idrac_password: "user_password"
- network_id: NIC.Integrated.1
- network_port_id: "NIC.Integrated.1-1-1"
+ network_adapter_id: NIC.Integrated.1
+ network_device_function_id: "NIC.Integrated.1-1-1"
network_attributes:
Ethernet:
VLAN:
@@ -319,12 +319,9 @@ error_info:
import json
import time
from urllib.error import HTTPError, URLError
-
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.compat.version import LooseVersion
from ansible.module_utils.urls import ConnectionError, SSLValidationError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import (
- idrac_auth_params, iDRACRedfishAPI)
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import (
delete_job, get_current_time, get_dynamic_uri, get_idrac_firmware_version,
get_scheduled_job_resp, remove_key, validate_and_get_first_resource_id_uri,
@@ -713,13 +710,12 @@ def main():
"job_wait": {"type": "bool", "default": True},
"job_wait_timeout": {"type": "int", "default": 1200}
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(argument_spec=specs,
- mutually_exclusive=[
- ('network_attributes', 'oem_network_attributes')],
- required_if=[["apply_time", "AtMaintenanceWindowStart", ("maintenance_window",)],
- ["apply_time", "InMaintenanceWindowOnReset", ("maintenance_window",)]],
- supports_check_mode=True)
+
+ module = IdracAnsibleModule(argument_spec=specs,
+ mutually_exclusive=[('network_attributes', 'oem_network_attributes')],
+ required_if=[["apply_time", "AtMaintenanceWindowStart", ("maintenance_window",)],
+ ["apply_time", "InMaintenanceWindowOnReset", ("maintenance_window",)]],
+ supports_check_mode=True)
with iDRACRedfishAPI(module.params, req_session=True) as idrac:
if module_attribute := module.params.get('network_attributes'):
network_attr_obj = NetworkAttributes(idrac, module)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_redfish_storage_controller.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_redfish_storage_controller.py
index 40cc5768d..1695f2b6f 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_redfish_storage_controller.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_redfish_storage_controller.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.1.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -519,9 +519,8 @@ error_info:
import json
-from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, RedfishAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import wait_for_job_completion, strip_substr_dict
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -1001,8 +1000,7 @@ def main():
"job_wait_timeout": {"required": False, "type": "int", "default": 120},
"size": {"required": False, "type": "int"}
}
- specs.update(redfish_auth_params)
- module = AnsibleModule(
+ module = RedfishAnsibleModule(
argument_spec=specs,
mutually_exclusive=[('attributes', 'command'), ("target", "size")],
required_one_of=[('attributes', 'command')],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_reset.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_reset.py
index 940f86dc2..48aff3dcf 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_reset.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_reset.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.2.0
+# Version 9.3.0
# Copyright (C) 2018-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -20,7 +20,7 @@ version_added: "2.1.0"
description:
- This module resets the iDRAC to factory default settings.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
reset_to_default:
type: str
@@ -55,7 +55,7 @@ options:
job_wait_timeout:
description:
- Time in seconds to wait for job completion.
- - This is applicable when I(job_wait) is C(true).
+ - This is applicable when I(wait_for_idrac) is C(true).
type: int
default: 600
version_added: 9.2.0
@@ -184,8 +184,7 @@ import os
import json
import time
from urllib.error import HTTPError, URLError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
-from ansible.module_utils.basic import AnsibleModule
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible.module_utils.compat.version import LooseVersion
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import (
@@ -532,8 +531,8 @@ def main():
"job_wait_timeout": {"type": 'int', "default": 600},
"force_reset": {"type": "bool", "default": False}
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
mutually_exclusive=[("custom_defaults_file", "custom_defaults_buffer")],
supports_check_mode=True)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_server_config_profile.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_server_config_profile.py
index f89272ca3..216a79da4 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_server_config_profile.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_server_config_profile.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.4.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -22,7 +22,7 @@ description:
- Export the Server Configuration Profile (SCP) from the iDRAC or import from a
network share (CIFS, NFS, HTTP, HTTPS) or a local path.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
command:
description:
@@ -527,8 +527,7 @@ import os
import json
from datetime import datetime
from os.path import exists
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import idrac_redfish_job_tracking, \
strip_substr_dict
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -919,8 +918,8 @@ class PreviewCommand():
def main():
specs = get_argument_spec()
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
required_if=[
["command", "export", ["share_name"]],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_session.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_session.py
index 3303b4ade..ac4e9b85c 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_session.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_session.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.2.0
+# Version 9.3.0
# Copyright (C) 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -28,12 +28,14 @@ options:
type: str
username:
description:
- - Username of the iDRAC.
+ - Username of the iDRAC. If the username is not provided, then
+ the environment variable E(IDRAC_USERNAME) is used.
- I(username) is required when I(state) is C(present).
type: str
password:
description:
- - Password of the iDRAC.
+ - Password of the iDRAC. If the password is not provided, then
+ the environment variable E(IDRAC_PASSWORD) is used.
- I(password) is required when I(state) is C(present).
type: str
port:
@@ -65,20 +67,22 @@ options:
choices: [present, absent]
type: str
default: present
- auth_token:
+ x_auth_token:
description:
- Authentication token.
- - I(auth_token) is required when I(state) is C(absent).
+ - I(x_auth_token) is required when I(state) is C(absent).
type: str
session_id:
description:
- Session ID of the iDRAC.
- I(session_id) is required when I(state) is C(absent).
type: int
+ aliases: ['auth_token']
requirements:
- "python >= 3.9.6"
author:
- "Rajshekar P(@rajshekarp87)"
+ - "Kritika Bhateja (@Kritika-Bhateja-03)"
notes:
- Run this module from a system that has direct access to Dell iDRAC.
- This module supports IPv4 and IPv6 addresses.
@@ -93,14 +97,47 @@ EXAMPLES = r"""
hostname: 198.162.0.1
username: username
password: password
+ ca_path: "/path/to/ca_cert.pem"
state: present
- name: Delete a session
dellemc.openmanage.idrac_session:
hostname: 198.162.0.1
+ ca_path: "/path/to/ca_cert.pem"
state: absent
- auth_token: aed4aa802b748d2f3b31deec00a6b28a
- session_is: 2
+ x_auth_token: aed4aa802b748d2f3b31deec00a6b28a
+ session_id: 2
+
+- name: Create a session and execute other modules
+ block:
+ - name: Create a session
+ dellemc.openmanage.idrac_session:
+ hostname: 198.162.0.1
+ username: username
+ password: password
+ ca_path: "/path/to/ca_cert.pem"
+ state: present
+ register: authData
+
+ - name: Call idrac_firmware_info module
+ dellemc.openmanage.idrac_firmware_info:
+ idrac_ip: 198.162.0.1
+ ca_path: "/path/to/ca_cert.pem"
+ x_auth_token: "{{ authData.x_auth_token }}"
+
+ - name: Call idrac_user_info module
+ dellemc.openmanage.idrac_user_info:
+ idrac_ip: 198.162.0.1
+ ca_path: "/path/to/ca_cert.pem"
+ x_auth_token: "{{ authData.x_auth_token }}"
+ always:
+ - name: Destroy a session
+ dellemc.openmanage.idrac_session:
+ hostname: 198.162.0.1
+ ca_path: "/path/to/ca_cert.pem"
+ state: absent
+ x_auth_token: "{{ authData.x_auth_token }}"
+ session_id: "{{ authData.session_data.Id }}"
"""
RETURN = r'''
@@ -361,7 +398,7 @@ def main():
argument_spec=specs,
required_if=[
["state", "present", ("username", "password",)],
- ["state", "absent", ("auth_token", "session_id",)]
+ ["state", "absent", ("x_auth_token", "session_id",)]
],
supports_check_mode=True
)
@@ -400,7 +437,7 @@ def get_argument_spec():
- "timeout": An integer representing the timeout value. The default value is 30.
- "state": A string representing the state. The default value is "present". The choices are
["present", "absent"].
- - "auth_token": A string representing the authentication token. It is marked as not to be
+ - "x_auth_token": A string representing the authentication token. It is marked as not to be
logged.
- "session_id": An integer representing the session ID.
@@ -416,7 +453,7 @@ def get_argument_spec():
"ca_path": {"type": "path", "default": None},
"timeout": {"type": "int", "default": 30},
"state": {"type": 'str', "default": "present", "choices": ["present", "absent"]},
- "auth_token": {"type": "str", "no_log": True},
+ "x_auth_token": {"type": "str", "no_log": True, "aliases": ['auth_token']},
"session_id": {"type": "int"}
}
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_storage_volume.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_storage_volume.py
index 13c1ec065..eec8ef043 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_storage_volume.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_storage_volume.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.1.0
+# Version 9.3.0
# Copyright (C) 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -21,7 +21,7 @@ version_added: "9.1.0"
description:
- This module is responsible for configuring the RAID attributes.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
state:
type: str
@@ -128,6 +128,12 @@ options:
- This option is applicable when I(job_wait) is C(true).
type: int
default: 900
+ time_to_wait:
+ description:
+ - The maximum wait time before shutdown in seconds for the Server Configuration Profile (SCP) import operation.
+ - This option is applicable when I(state) is C(create) or C(delete).
+ type: int
+ default: 300
requirements:
- "python >= 3.9.6"
@@ -281,8 +287,7 @@ import re
import operator
from urllib.error import HTTPError, URLError
from copy import deepcopy
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
-from ansible.module_utils.basic import AnsibleModule
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import (
get_dynamic_uri, validate_and_get_first_resource_id_uri, xml_data_conversion, idrac_redfish_job_tracking, remove_key, get_idrac_firmware_version)
@@ -303,6 +308,7 @@ ID_AND_LOCATION_BOTH_NOT_DEFINED = "Either id or location should be specified."
DRIVES_NOT_DEFINED = "Drives must be defined for volume creation."
NOT_ENOUGH_DRIVES = "Number of sufficient disks not found in Controller '{controller_id}'!"
WAIT_TIMEOUT_MSG = "The job is not complete after {0} seconds."
+TIME_TO_WAIT_MSG = "Time to wait value is invalid. Minimum value is 300 and Maximum is 3600 seconds."
JOB_TRIGERRED = "Successfully triggered the {0} storage volume operation."
VOLUME_NAME_REQUIRED_FOR_DELETE = "Virtual disk name is a required parameter for remove virtual disk operations."
VOLUME_NOT_FOUND = "Unable to find the virtual disk."
@@ -551,6 +557,11 @@ class StorageValidation(StorageBase):
self.idrac_data = StorageData(idrac, module).all_storage_data()
self.controller_id = module.params.get("controller_id")
+ def validate_time_to_wait(self):
+ to_wait = self.module_ext_params.get("time_to_wait")
+ if to_wait < 300 or to_wait > 3600:
+ self.module.exit_json(msg=TIME_TO_WAIT_MSG, failed=True)
+
def validate_controller_exists(self):
if not self.controller_id:
self.module.exit_json(msg=CONTROLLER_NOT_DEFINED, failed=True)
@@ -720,6 +731,7 @@ class StorageCreate(StorageValidation):
def validate(self):
# Validate upper layer input
+ self.validate_time_to_wait()
self.validate_controller_exists()
self.validate_job_wait_negative_values()
# Validate std raid validation for inner layer
@@ -741,7 +753,7 @@ class StorageCreate(StorageValidation):
parent_payload = """<SystemConfiguration>{0}</SystemConfiguration>"""
payload = self.constuct_payload(name_id_mapping)
parent_payload = parent_payload.format(payload)
- resp = self.idrac.import_scp(import_buffer=parent_payload, target="RAID", job_wait=False)
+ resp = self.idrac.import_scp(import_buffer=parent_payload, target="RAID", job_wait=False, time_to_wait=self.module.params.get('time_to_wait'))
job_dict = self.wait_for_job_completion(resp)
return job_dict
@@ -768,6 +780,7 @@ class StorageDelete(StorageValidation):
def validate(self):
# Validate upper layer input
+ self.validate_time_to_wait()
self.validate_job_wait_negative_values()
# Validate for volume and volume_name
@@ -803,7 +816,7 @@ class StorageDelete(StorageValidation):
self.validate_volume_exists_in_server(set(volume_name_input_list))
cntrl_id_vd_id_mapping = self.get_vd_id_based_on_controller_id_vd_name(set(volume_name_input_list))
payload = self.construct_payload_for_delete(cntrl_id_vd_id_mapping)
- resp = self.idrac.import_scp(import_buffer=payload, target="RAID", job_wait=False)
+ resp = self.idrac.import_scp(import_buffer=payload, target="RAID", job_wait=False, time_to_wait=self.module.params.get('time_to_wait'))
job_dict = self.wait_for_job_completion(resp)
return job_dict
@@ -891,10 +904,11 @@ def main():
"raid_reset_config": {"choices": ['true', 'false'], "default": 'false'},
"raid_init_operation": {"choices": ['None', 'Fast']},
"job_wait": {"type": "bool", "default": True},
- "job_wait_timeout": {"type": "int", "default": 900}
+ "job_wait_timeout": {"type": "int", "default": 900},
+ "time_to_wait": {"type": "int", "default": 300}
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
supports_check_mode=True)
try:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_user.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_user.py
index bcd16b872..4cd67b7b5 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_user.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_user.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.1.0
-# Copyright (C) 2018-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2018-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -24,7 +24,7 @@ description:
- Edit a user account.
- Enable or Disable a user account.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
state:
type: str
@@ -101,7 +101,7 @@ options:
- A privacy protocol is not configured if C(None) is selected.
choices: [None, DES, AES]
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Felix Stephen (@felixs88)"
notes:
- Run this module from a system that has direct access to Dell iDRAC.
@@ -209,9 +209,7 @@ import time
from ssl import SSLError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
-from ansible.module_utils.basic import AnsibleModule
-
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
ACCOUNT_URI = "/redfish/v1/Managers/iDRAC.Embedded.1/Accounts/"
ATTRIBUTE_URI = "/redfish/v1/Managers/iDRAC.Embedded.1/Attributes/"
@@ -412,8 +410,7 @@ def main():
"authentication_protocol": {"required": False, "choices": ['SHA', 'MD5', 'None']},
"privacy_protocol": {"required": False, "choices": ['AES', 'DES', 'None']},
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+ module = IdracAnsibleModule(
argument_spec=specs,
supports_check_mode=True)
try:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_user_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_user_info.py
index 6d06a60be..895e0d338 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_user_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_user_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -22,7 +22,7 @@ description:
- "This module retrieves the list and basic details of all users or details of a specific user on
iDRAC"
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
user_id:
description:
@@ -35,7 +35,7 @@ options:
- Username of the account that is created in iDRAC local users.
- I(username) is mutually exclusive with I(user_id)
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Husniya Hameed(@husniya_hameed)"
notes:
- Run this module on a system that has direct access to Dell iDRAC.
@@ -116,8 +116,7 @@ import json
from ssl import SSLError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
-from ansible.module_utils.basic import AnsibleModule
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import strip_substr_dict
@@ -193,8 +192,8 @@ def main():
"user_id": {"type": 'int'},
"username": {"type": 'str'}
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(
+
+ module = IdracAnsibleModule(
argument_spec=specs,
mutually_exclusive=[
('user_id', 'username')
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_virtual_media.py b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_virtual_media.py
index 4c5fb10db..aef7c2a70 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/idrac_virtual_media.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/idrac_virtual_media.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 6.3.0
-# Copyright (C) 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -21,7 +21,7 @@ version_added: "6.3.0"
description:
- This module allows to configure Remote File Share settings.
extends_documentation_fragment:
- - dellemc.openmanage.idrac_auth_options
+ - dellemc.openmanage.idrac_x_auth_options
options:
virtual_media:
required: true
@@ -78,7 +78,7 @@ options:
type: str
description: Resource id of the iDRAC, if not specified manager collection id will be used.
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Felix Stephen (@felixs88)"
notes:
@@ -217,8 +217,8 @@ import copy
import time
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params
-from ansible.module_utils.basic import AnsibleModule
+from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, IdracAnsibleModule
+
MANAGER_BASE = "/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia"
SYSTEM_BASE = "/redfish/v1/Systems/System.Embedded.1/VirtualMedia"
@@ -441,8 +441,8 @@ def main():
"force": {"required": False, "type": "bool", "default": False},
"resource_id": {"required": False, "type": 'str'},
}
- specs.update(idrac_auth_params)
- module = AnsibleModule(argument_spec=specs, supports_check_mode=True)
+
+ module = IdracAnsibleModule(argument_spec=specs, supports_check_mode=True)
try:
with iDRACRedfishAPI(module.params, req_session=True) as idrac:
vr_media = module.params["virtual_media"]
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_active_directory.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_active_directory.py
index 6f420bec7..b23f2d0ef 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_active_directory.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_active_directory.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -117,7 +117,7 @@ options:
- The certificate should be a Root CA Certificate encoded in Base64 format.
- This is applicable when I(validate_certificate) is C(true).
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
notes:
- The module will always report change when I(validate_certificate) is C(true).
- Run this module from a system that has direct access to OpenManage Enterprise.
@@ -241,10 +241,9 @@ error_info:
import json
import os
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.common.dict_transformations import recursive_diff
AD_URI = "AccountService/ExternalAccountProvider/ADAccountProvider"
@@ -418,8 +417,8 @@ def main():
"domain_username": {"type": 'str'},
"domain_password": {"type": 'str', "no_log": True}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_one_of=[('name', 'id')],
required_if=[
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies.py
index 9e8a17fd2..b279d9739 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.3.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -478,9 +478,8 @@ error_info:
import csv
import os
import json
-from ansible.module_utils.basic import AnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import get_all_data_with_pagination, strip_substr_dict
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.common.dict_transformations import recursive_diff
@@ -1083,11 +1082,11 @@ def main():
}
}
}
- specs.update(ome_auth_params)
+
present_args = ['enable', 'new_name', 'description', 'device_service_tag', 'device_group',
'specific_undiscovered_devices', 'any_undiscovered_devices', 'all_devices',
'category', 'message_ids', 'message_file', 'date_and_time', 'severity', 'actions']
- module = AnsibleModule(
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[['state', 'present', present_args, True]],
mutually_exclusive=[('device_service_tag', 'device_group', 'any_undiscovered_devices', 'specific_undiscovered_devices', 'all_devices',),
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_actions_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_actions_info.py
index 0d1f0c726..6bb50acf1 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_actions_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_actions_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -253,8 +253,7 @@ msg:
'''
import json
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import remove_key
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -267,8 +266,8 @@ EMPTY_ALERT_POLICY_ACTION_MSG = "No alert policies action information were found
def main():
""" function to retrieve the information on actions of alert policies """
- specs = ome_auth_params
- module = AnsibleModule(
+ specs = {}
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True)
try:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_category_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_category_info.py
index 6d3151fe9..0af0bf338 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_category_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_category_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -278,10 +278,9 @@ error_info:
'''
import json
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import remove_key
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import get_all_data_with_pagination
@@ -296,8 +295,8 @@ def get_formatted_categories(rest_obj):
def main():
- specs = ome_auth_params
- module = AnsibleModule(
+ specs = {}
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True)
try:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_info.py
index d9a97c070..51ed53b9d 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -129,8 +129,7 @@ error_info:
'''
import json
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import remove_key
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -182,13 +181,13 @@ class OMEAlertPolicyInfo:
self.module.exit_json(msg=str(err), failed=True)
-def get_module_parameters() -> AnsibleModule:
+def get_module_parameters() -> OmeAnsibleModule:
specs = {
"policy_name": {"type": 'str'}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(argument_spec=specs,
- supports_check_mode=True)
+
+ module = OmeAnsibleModule(argument_spec=specs,
+ supports_check_mode=True)
return module
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_message_id_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_message_id_info.py
index 577eac7d0..3bde29a33 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_message_id_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_alert_policies_message_id_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -105,8 +105,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import remove_key, get_all_data_with_pagination
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -117,8 +116,8 @@ EMPTY_MSG = "No alert policies message id information were found."
def main():
- specs = ome_auth_params
- module = AnsibleModule(
+ specs = {}
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True
)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_smtp.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_smtp.py
index 58572bae0..855c7b022 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_smtp.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_smtp.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -57,7 +57,7 @@ options:
type: str
required: true
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
notes:
- The module will always report change when I(enable_authentication) is C(true).
- Run this module from a system that has direct access to Dell OpenManage Enterprise
@@ -139,10 +139,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.common.dict_transformations import recursive_diff
SUCCESS_MSG = "Successfully updated the SMTP settings."
@@ -235,8 +234,8 @@ def main():
"options": credentials_options,
},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[['enable_authentication', True, ['credentials']], ],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_syslog.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_syslog.py
index a72093752..ecb20b336 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_syslog.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_alerts_syslog.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -44,7 +44,7 @@ options:
description: The UDP port number of the syslog server.
type: int
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- Jagadeesh N V(@jagadeeshnv)
notes:
@@ -152,10 +152,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.common.dict_transformations import recursive_diff
from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict
@@ -232,9 +231,8 @@ def main():
"required_if": [("enabled", True, ("destination_address",))]
}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True
)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_certificate.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_certificate.py
index 60f170f76..b8283537c 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_certificate.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_certificate.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.3.0
-# Copyright (C) 2020-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -159,8 +159,7 @@ error_info:
import json
import os
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -195,6 +194,21 @@ def get_san(subject_alternative_names):
return subject_alternative_names.replace(" ", "")
+def format_csr_string(csr_string):
+ # Remove the header and footer
+ csr_string = csr_string.replace("-----BEGIN CERTIFICATE REQUEST-----", "")
+ csr_string = csr_string.replace("-----END CERTIFICATE REQUEST-----", "")
+ csr_string = csr_string.replace("\n", "")
+
+ # Format the remaining string with proper line breaks
+ formatted_csr = '\n'.join([csr_string[i:i + 64] for i in range(0, len(csr_string), 64)])
+
+ # Add the header and footer back
+ formatted_csr = "-----BEGIN CERTIFICATE REQUEST-----\n" + formatted_csr + "\n-----END CERTIFICATE REQUEST-----"
+
+ return formatted_csr
+
+
def main():
specs = {
"command": {"type": "str", "required": False,
@@ -209,8 +223,8 @@ def main():
"upload_file": {"required": False, "type": "str"},
"subject_alternative_names": {"required": False, "type": "str"}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[["command", "generate_csr", ["distinguished_name", "department_name",
"business_name", "locality", "country_state",
@@ -228,8 +242,11 @@ def main():
resp = rest_obj.invoke_request(method, uri, headers=headers, data=payload, dump=dump)
if resp.success:
if command == "generate_csr":
+ resp_copy = resp.json_data
+ formated_csr = format_csr_string(resp_copy["CertificateData"])
+ resp_copy["CertificateData"] = formated_csr
module.exit_json(msg="Successfully generated certificate signing request.",
- csr_status=resp.json_data)
+ csr_status=resp_copy)
module.exit_json(msg="Successfully uploaded application certificate.", changed=True)
except HTTPError as err:
module.fail_json(msg=str(err), error_info=json.load(err))
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_console_preferences.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_console_preferences.py
index 760546f02..93c0b9af2 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_console_preferences.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_console_preferences.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.1.0
+# Version 9.3.0
# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -365,10 +365,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import strip_substr_dict
SUCCESS_MSG = "Successfully updated the Console Preferences settings."
@@ -631,13 +630,13 @@ def main():
"trap_forwarding_format": {"required": False, "type": "str", "choices": ["Normalized", "Original"]},
"metrics_collection_settings": {"required": False, "type": "int"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(argument_spec=specs,
- required_one_of=[["report_row_limit", "device_health", "discovery_settings",
- "server_initiated_discovery", "mx7000_onboarding_preferences",
- "builtin_appliance_share", "email_sender_settings",
- "trap_forwarding_format", "metrics_collection_settings"]],
- supports_check_mode=True, )
+
+ module = OmeAnsibleModule(argument_spec=specs,
+ required_one_of=[["report_row_limit", "device_health", "discovery_settings",
+ "server_initiated_discovery", "mx7000_onboarding_preferences",
+ "builtin_appliance_share", "email_sender_settings",
+ "trap_forwarding_format", "metrics_collection_settings"]],
+ supports_check_mode=True)
try:
_validate_params(module)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_address.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_address.py
index ab8814a42..bdea896f4 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_address.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_address.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -182,7 +182,7 @@ options:
- This option is not mandatory.
type: int
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V(@jagadeeshnv)"
'''
@@ -426,8 +426,7 @@ error_info:
import json
import socket
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -716,8 +715,8 @@ def main():
},
"reboot_delay": {"required": False, "type": "int"}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[
["enable_nic", True,
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_proxy.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_proxy.py
index 0ca58de09..76ee7c961 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_proxy.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_proxy.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -56,7 +56,7 @@ options:
- This option is mandatory when I(enable_authentication) is true.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Sajna Shetty(@Sajna-Shetty)"
notes:
@@ -145,8 +145,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -225,8 +224,8 @@ def main():
"proxy_password": {"required": False, "type": "str", "no_log": True},
"enable_authentication": {"required": False, "type": "bool"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[['enable_proxy', True, ['ip_address', 'proxy_port']],
['enable_authentication', True, ['proxy_username', 'proxy_password']], ],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_settings.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_settings.py
index 91a0de1d7..d14388e95 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_settings.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_settings.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -81,7 +81,7 @@ options:
- This is applicable only for OpenManage Enterprise Modular.
type: int
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise
or OpenManage Enterprise Modular.
@@ -250,10 +250,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
SUCCESS_MSG = "Successfully updated the session timeout settings."
SESSION_INACTIVITY_GET = "SessionService/SessionConfiguration"
@@ -355,9 +354,8 @@ def main():
]
}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True
)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_time.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_time.py
index baf533c0a..c206b59a4 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_time.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_time.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -55,7 +55,7 @@ options:
- This option is applicable when I(enable_ntp) is true.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Sajna Shetty(@Sajna-Shetty)"
notes:
@@ -139,8 +139,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -230,8 +229,8 @@ def main():
"secondary_ntp_address1": {"required": False, "type": "str"},
"secondary_ntp_address2": {"required": False, "type": "str"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[['enable_ntp', False, ('time_zone', 'system_time',), True],
['enable_ntp', True, ('time_zone', 'primary_ntp_address',
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_webserver.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_webserver.py
index 9e6cdffd5..f012fa977 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_webserver.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_network_webserver.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -35,7 +35,7 @@ options:
- If a change is made to the session timeout, it will only take effect after the next log in.
type: int
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V(@jagadeeshnv)"
notes:
@@ -114,8 +114,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -162,8 +161,8 @@ def main():
"webserver_port": {"required": False, "type": "int"},
"webserver_timeout": {"required": False, "type": "int"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_one_of=[["webserver_port", "webserver_timeout"]],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_security_settings.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_security_settings.py
index af869fb16..f75554f02 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_security_settings.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_application_security_settings.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -94,7 +94,7 @@ options:
author:
- Jagadeesh N V(@jagadeeshnv)
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise or OpenManage Enterprise Modular.
- This module supports C(check_mode).
@@ -202,8 +202,7 @@ JOB_POLL_INTERVAL = 3
import json
import time
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -333,9 +332,8 @@ def main():
"job_wait": {"type": 'bool', "default": True},
"job_wait_timeout": {"type": 'int', "default": 120}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[("fips_mode_enable", "login_lockout_policy"),
("fips_mode_enable", "restrict_allowed_ip_range")],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_chassis_slots.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_chassis_slots.py
index adcc53566..65274ec5b 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_chassis_slots.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_chassis_slots.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -72,7 +72,7 @@ options:
description: Provide name for the slot.
required: true
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
notes:
- "This module initiates the refresh inventory task. It may take a minute for new names to be reflected.
If the task exceeds 300 seconds to refresh, the task times out."
@@ -254,10 +254,9 @@ error_info:
import json
import time
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.common.dict_transformations import recursive_diff
DEVICE_URI = "DeviceService/Devices"
@@ -578,8 +577,8 @@ def main():
},
},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_one_of=[('slot_options', 'device_options')],
mutually_exclusive=[('slot_options', 'device_options')],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_baseline.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_baseline.py
index fa0f2a90a..31f4f6ed1 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_baseline.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_baseline.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.6.0
-# Copyright (C) 2021-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -106,7 +106,7 @@ options:
type: int
default: 10800
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Sajna Shetty(@Sajna-Shetty)"
- "Abhishek Sinha(@Abhishek-Dell)"
@@ -291,8 +291,7 @@ error_info:
import json
import time
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.compat.version import LooseVersion
@@ -811,8 +810,8 @@ def main():
"job_wait_timeout": {"required": False, "type": 'int', "default": 10800},
"new_name": {"type": 'str'},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[
['command', 'create', ['template_name', 'template_id'], True],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_info.py
index 8132ffe9d..39c202f92 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_configuration_compliance_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 6.1.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -42,7 +42,7 @@ options:
- I(device_service_tag) is mutually exclusive with I(device_id).
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Felix Stephen A (@felixs88)"
- "Kritika Bhateja (@Kritika-Bhateja)"
@@ -148,8 +148,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -222,8 +221,8 @@ def main():
"device_id": {"required": False, "type": "int"},
"device_service_tag": {"required": False, "type": "str"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[["device_id", "device_service_tag"]],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_group.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_group.py
index f6a085cd9..49bb23d96 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_group.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_group.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 6.1.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -70,7 +70,7 @@ options:
available in OpenManage Enterprise.The module reports failure only if none of the IP addresses provided in the
list are available in OpenManage Enterprise.
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
- "netaddr >= 0.7.19"
author:
- "Felix Stephen (@felixs88)"
@@ -277,8 +277,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
@@ -480,16 +479,16 @@ def main():
"device_ids": {"required": False, "type": "list", "elements": 'int'},
"ip_addresses": {"required": False, "type": "list", "elements": 'str'},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
- required_if=(
+ required_if=[
["state", "present", ("device_ids", "device_service_tags", "ip_addresses"), True],
- ),
- mutually_exclusive=(
+ ],
+ mutually_exclusive=[
("name", "group_id"),
("device_ids", "device_service_tags", "ip_addresses"),
- ),
+ ],
required_one_of=[("name", "group_id"),
("device_ids", "device_service_tags", "ip_addresses")],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_info.py
index 62430402c..ee1ca2c46 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.1.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -59,7 +59,7 @@ options:
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Sajna Shetty (@Sajna-Shetty)"
- "Felix Stephen (@felixs88)"
@@ -195,8 +195,8 @@ device_info:
'''
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import get_all_data_with_pagination
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -376,8 +376,8 @@ def main():
"choices": ['basic_inventory', 'detailed_inventory', 'subsystem_health']},
"system_query_options": system_query_options,
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[['fact_subset', 'detailed_inventory', ['system_query_options']],
['fact_subset', 'subsystem_health', ['system_query_options']]],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_local_access_configuration.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_local_access_configuration.py
index c6245a6de..7cec5d985 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_local_access_configuration.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_local_access_configuration.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.1.0
+# Version 9.3.0
# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -261,10 +261,9 @@ import json
import socket
import copy
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
DOMAIN_URI = "ManagementDomainService/Domains"
DEVICE_URI = "DeviceService/Devices"
@@ -450,8 +449,8 @@ def main():
"required": False, "type": "dict", "options": lcd_options,
},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[('device_id', 'device_service_tag')],
required_one_of=[["enable_kvm_access", "enable_chassis_direct_access",
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_location.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_location.py
index 9c73b7c46..a03ba5116 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_location.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_location.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -55,7 +55,7 @@ options:
type: str
description: The physical location of the chassis.
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Felix Stephen (@felixs88)"
notes:
@@ -153,10 +153,9 @@ error_info:
import json
import socket
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
LOCATION_API = "DeviceService/Devices({0})/Settings('Location')"
DEVICE_URI = "DeviceService/Devices"
@@ -278,8 +277,8 @@ def main():
"rack_slot": {"required": False, "type": "int"},
"location": {"required": False, "type": "str"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[('device_id', 'device_service_tag')],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_mgmt_network.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_mgmt_network.py
index 0d4b0a483..a7d5477a5 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_mgmt_network.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_mgmt_network.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -229,7 +229,7 @@ options:
- Enter the IP address of the second alternate DNS server.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise Modular.
- This module supports C(check_mode).
@@ -370,10 +370,9 @@ import json
import socket
import copy
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.common.dict_transformations import recursive_diff
DEVICE_URI = "DeviceService/Devices"
@@ -748,8 +747,8 @@ def main():
"required_one_of": [("preferred_dns_server", "alternate_dns_server1", "alternate_dns_server2")]
}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_one_of=[('device_id', 'device_service_tag')],
mutually_exclusive=[('device_id', 'device_service_tag')],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_network_services.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_network_services.py
index 6d1518b34..d91d6e136 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_network_services.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_network_services.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -79,7 +79,7 @@ options:
required: true
description: Enables or disables the remote RACADM settings.
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Felix Stephen (@felixs88)"
notes:
@@ -192,10 +192,9 @@ error_info:
import json
import socket
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
DOMAIN_URI = "ManagementDomainService/Domains"
DEVICE_URI = "DeviceService/Devices"
@@ -369,8 +368,8 @@ def main():
"ssh_settings": {"type": "dict", "required": False, "options": ssh_options},
"remote_racadm_settings": {"type": "dict", "required": False, "options": racadm_options},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[('device_id', 'device_service_tag')],
required_one_of=[["snmp_settings", "ssh_settings", "remote_racadm_settings"]],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_power_settings.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_power_settings.py
index f0587791e..9bab4de02 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_power_settings.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_power_settings.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -77,7 +77,7 @@ options:
choices: ['GRID_1', 'GRID_2']
default: GRID_1
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Felix Stephen (@felixs88)"
notes:
@@ -168,10 +168,9 @@ import json
import socket
import copy
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
POWER_API = "DeviceService/Devices({0})/Settings('Power')"
DEVICE_URI = "DeviceService/Devices"
DOMAIN_URI = "ManagementDomainService/Domains"
@@ -314,8 +313,8 @@ def main():
"hot_spare_configuration": {"type": "dict", "required": False, "options": hot_spare_options,
"required_if": [["enable_hot_spare", True, ("primary_grid",)]]},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[('device_id', 'device_service_tag')],
required_one_of=[["power_configuration", "redundancy_configuration", "hot_spare_configuration"]],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_quick_deploy.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_quick_deploy.py
index 7d45bf7e9..d343576be 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_quick_deploy.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_device_quick_deploy.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.1.0
+# Version 9.3.0
# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -349,10 +349,9 @@ import copy
import json
import socket
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
DOMAIN_URI = "ManagementDomainService/Domains"
DEVICE_URI = "DeviceService/Devices"
@@ -663,10 +662,10 @@ def main():
"job_wait": {"type": "bool", "default": True},
"job_wait_timeout": {"type": "int", "default": 120},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(argument_spec=specs,
- mutually_exclusive=[('device_id', 'device_service_tag')],
- supports_check_mode=True,)
+
+ module = OmeAnsibleModule(argument_spec=specs,
+ mutually_exclusive=[('device_id', 'device_service_tag')],
+ supports_check_mode=True,)
if module.params["quick_deploy_options"] is None:
module.exit_json(msg="missing required arguments: quick_deploy_options", failed=True)
fields = [("ipv4_subnet_mask", "IPV4"), ("ipv4_gateway", "IPV4"), ("ipv6_gateway", "IPV6")]
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_devices.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_devices.py
index 2dc7b625d..0b8181932 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_devices.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_devices.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.1.0
+# Version 9.3.0
# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -230,10 +230,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import strip_substr_dict, job_tracking
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import CHANGES_MSG, NO_CHANGES_MSG
@@ -410,8 +409,8 @@ def main():
"job_description": {"type": "str"},
# "job_params": {"type": "dict"}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[],
mutually_exclusive=[
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_diagnostics.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_diagnostics.py
index b16604c3c..64650b9ff 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_diagnostics.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_diagnostics.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2021-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -128,7 +128,7 @@ options:
- I(lead_chassis_only) is only applicable when I(log_type) is C(application) on OpenManage Enterprise Modular.
default: false
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Felix Stephen (@felixs88)"
- "Sachin Apagundi(@sachin-apa)"
@@ -267,8 +267,7 @@ error_info:
import json
import re
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
LOG_SELECTOR = {"OS_LOGS": 1, "RAID_LOGS": 2, "DEBUG_LOGS": 3}
@@ -431,8 +430,8 @@ def main():
"test_connection": {"required": False, "type": "bool", "default": False},
"lead_chassis_only": {"required": False, "type": "bool", "default": False},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[
['log_type', 'application', ['mask_sensitive_info']],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_discovery.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_discovery.py
index f50d8f25e..f0747d5d1 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_discovery.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_discovery.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.1.0
-# Copyright (C) 2021-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -366,7 +366,7 @@ options:
description: KgKey for the IPMI protocol.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V (@jagadeeshnv)"
- "Sajna Shetty (@Sajna-Shetty)"
@@ -644,8 +644,7 @@ error_info:
import json
import time
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import strip_substr_dict
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -1056,8 +1055,8 @@ def main():
"email_recipient": {"type": 'str'},
"ignore_partial_failure": {"type": 'bool', "default": False}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[
['state', 'present', ('discovery_config_targets',)],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_domain_user_groups.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_domain_user_groups.py
index bd15dccc6..52fee50df 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_domain_user_groups.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_domain_user_groups.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.2.0
-# Copyright (C) 2021-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -194,8 +194,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
ROLE_URI = "AccountService/Roles"
@@ -346,8 +345,8 @@ def main():
"domain_username": {"required": False, "type": 'str'},
"domain_password": {"required": False, "type": 'str', "no_log": True},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[['directory_name', 'directory_id'], ],
supports_check_mode=True)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware.py
index 5e83a07d5..ee15e45b7 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.3.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -351,8 +351,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -650,8 +649,8 @@ def main():
"required_one_of": [('id', 'service_tag')]
},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_one_of=[["dup_file", "baseline_name"]],
mutually_exclusive=[
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline.py
index 6c2c6a1c5..3b13d272d 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.1.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -109,7 +109,7 @@ options:
version_added: 8.1.0
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise or OpenManage Enterprise Modular.
- I(device_group_names) option is not applicable for OpenManage Enterprise Modular.
@@ -315,8 +315,7 @@ GROUP_ID = 6000
import json
import time
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.common.dict_transformations import recursive_diff
@@ -568,8 +567,8 @@ def main():
"job_wait_timeout": {"type": 'int', "default": 600},
"filter_no_reboot_required": {"type": 'bool'}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[
('device_ids', 'device_service_tags', 'device_group_names'),
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_compliance_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_compliance_info.py
index af48fc151..8866cc993 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_compliance_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_compliance_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -61,7 +61,7 @@ options:
type: list
elements: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Sajna Shetty(@Sajna-Shetty)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -225,8 +225,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -391,8 +390,8 @@ def main():
"device_ids": {"required": False, "type": "list", "elements": 'int'},
"device_group_names": {"required": False, "type": "list", "elements": 'str'},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[['baseline_name', 'device_service_tags', 'device_ids', 'device_group_names']],
required_one_of=[['device_ids', 'device_service_tags', 'device_group_names', 'baseline_name']],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_info.py
index 261d67030..ddc6531fb 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_baseline_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -28,7 +28,7 @@ options:
all the available firmware baselines are returned.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Sajna Shetty(@Sajna-Shetty)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -101,8 +101,7 @@ baseline_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
@@ -124,8 +123,8 @@ def main():
specs = {
"baseline_name": {"type": 'str', "required": False},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True
)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_catalog.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_catalog.py
index b437db3ae..b477fd9ac 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_catalog.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_firmware_catalog.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -114,7 +114,7 @@ options:
default: 600
version_added: 3.4.0
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Sajna Shetty(@Sajna-Shetty)"
- "Jagadeesh N V(@jagadeeshnv)"
@@ -354,8 +354,7 @@ import json
import time
import os
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import remove_key
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -621,8 +620,8 @@ def main():
"job_wait": {"type": 'bool', "default": True},
"job_wait_timeout": {"type": 'int', "default": 600}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[
['state', 'present',
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_groups.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_groups.py
index 3daf178cf..94d978aaa 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_groups.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_groups.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -71,7 +71,7 @@ options:
- This is applicable only when I(state) is C(present).
- This option is mutually exclusive with I(parent_group_name).
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
notes:
- This module manages only static device groups on Dell OpenManage Enterprise.
- If a device group with the name I(parent_group_name) does not exist, a new device group with the same name is created.
@@ -194,10 +194,9 @@ error_info:
import json
import time
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
GROUP_URI = "GroupService/Groups"
OP_URI = "GroupService/Actions/GroupService.{op}Group"
@@ -406,8 +405,8 @@ def main():
"parent_group_name": {"type": "str", "default": STATIC_ROOT},
"parent_group_id": {"type": "int"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[
["state", "present", ("new_name", "description", "parent_group_name", "parent_group_id"), True],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_identity_pool.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_identity_pool.py
index 9a627b234..04ffa88eb 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_identity_pool.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_identity_pool.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -124,7 +124,7 @@ options:
description: Number of MAC addresses.I(identity_count) is required to option to create FC settings.
type: int
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Sajna Shetty(@Sajna-Shetty)"
- "Deepak Joshi(@Dell-Deepak-Joshi))"
@@ -263,8 +263,7 @@ import json
import codecs
import binascii
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -575,8 +574,8 @@ def main():
"options": iscsi_specific_settings},
"fc_settings": {"required": False, "type": "dict", "options": fc_settings},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True
)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_job_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_job_info.py
index 8a875c756..ab166dacf 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_job_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_job_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.1.0
-# Copyright (C) 2020-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -46,7 +46,7 @@ options:
type: bool
default: false
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V (@jagadeeshnv)"
- "Abhishek Sinha (@Abhishek-Dell)"
@@ -292,8 +292,7 @@ job_info:
'''
import json
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import strip_substr_dict, remove_key
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -364,8 +363,8 @@ def main():
}},
"fetch_execution_history": {"type": 'bool', "default": False},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True
)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_port_breakout.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_port_breakout.py
index 044601d0d..65b7c869f 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_port_breakout.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_port_breakout.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -35,7 +35,7 @@ options:
- To revoke the default breakout configuration, enter 'HardwareDefault'.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Felix Stephen (@felixs88)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise Modular.
@@ -126,8 +126,7 @@ error_info:
import json
import re
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -257,8 +256,8 @@ def main():
"target_port": {"required": True, "type": 'str'},
"breakout_type": {"required": True, "type": 'str'},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True
)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan.py
index 393f44a71..762acefac 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -63,7 +63,7 @@ options:
'Storage - iSCSI', 'Storage - FCoE', 'Storage - Data Replication',
'VM Migration', 'VMWare FT Logging']
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V(@jagadeeshnv)"
notes:
@@ -183,8 +183,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -318,8 +317,8 @@ def main():
'Storage - iSCSI', 'Storage - FCoE', 'Storage - Data Replication', 'VM Migration',
'VMWare FT Logging']}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[['state', 'present', ('new_name', 'description', 'vlan_minimum', 'vlan_maximum', 'type',), True]],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan_info.py
index ea9861a3b..fb315947a 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_network_vlan_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -37,7 +37,7 @@ options:
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Deepak Joshi(@deepakjoshishri)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -151,8 +151,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -216,8 +215,8 @@ def main():
"id": {"required": False, "type": 'int'},
"name": {"required": False, "type": 'str'}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[["id", "name"]],
supports_check_mode=True)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_powerstate.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_powerstate.py
index 0122848c4..b5056b133 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_powerstate.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_powerstate.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -38,7 +38,7 @@ options:
- I(device_id) is mutually exclusive with I(device_service_tag).
type: int
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Felix Stephen (@felixs88)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -157,8 +157,7 @@ job_status:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -251,8 +250,8 @@ def main():
"device_service_tag": {"required": False, "type": "str"},
"device_id": {"required": False, "type": "int"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_one_of=[["device_service_tag", "device_id"]],
mutually_exclusive=[["device_service_tag", "device_id"]],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_profile.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_profile.py
index eed9a45fd..adc189dc6 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_profile.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_profile.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -162,7 +162,7 @@ options:
- This is applicable when I(command) is C(assign).
type: dict
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Jagadeesh N V (@jagadeeshnv)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -397,8 +397,7 @@ error_info:
import json
import time
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.common.dict_transformations import recursive_diff
@@ -827,8 +826,8 @@ def main():
"attributes": {"type": 'dict', "options": assign_spec},
"force": {"default": False, "type": 'bool'}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[
['command', 'create', ['template_name', 'template_id'], True],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_profile_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_profile_info.py
index 4c5f07dd2..a3dd49e86 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_profile_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_profile_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.2.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -249,10 +249,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import strip_substr_dict
@@ -347,11 +346,10 @@ def main():
"template_name": {"type": 'str'},
"system_query_options": {"type": 'dict'}
}
- argument_spec.update(ome_auth_params)
- module = AnsibleModule(argument_spec=argument_spec,
- mutually_exclusive=[('profile_id', 'profile_name', 'template_name', 'template_id',
- 'system_query_options')],
- supports_check_mode=True)
+ module = OmeAnsibleModule(argument_spec=argument_spec,
+ mutually_exclusive=[('profile_id', 'profile_name', 'template_name', 'template_id',
+ 'system_query_options')],
+ supports_check_mode=True)
try:
with RestOME(module.params, req_session=True) as rest_obj:
query = {}
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profile_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profile_info.py
index 12286bff3..adf3ee810 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profile_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profile_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -35,7 +35,7 @@ options:
- I(device_service_tag) is mutually exclusive with I(device_id).
elements: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Felix Stephen (@felixs88)"
notes:
@@ -154,10 +154,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
DOMAIN_URI = "ManagementDomainService/Domains"
PROFILE_URI = "NetworkService/ServerProfiles"
@@ -237,11 +236,10 @@ def main():
"device_id": {"required": False, "type": "list", "elements": "int"},
"device_service_tag": {"required": False, "type": "list", "elements": "str"},
}
- argument_spec.update(ome_auth_params)
- module = AnsibleModule(argument_spec=argument_spec,
- mutually_exclusive=[('device_id', 'device_service_tag')],
- required_one_of=[["device_id", "device_service_tag"]],
- supports_check_mode=True, )
+ module = OmeAnsibleModule(argument_spec=argument_spec,
+ mutually_exclusive=[('device_id', 'device_service_tag')],
+ required_one_of=[["device_id", "device_service_tag"]],
+ supports_check_mode=True)
if not any([module.params.get("device_id"), module.params.get("device_service_tag")]):
module.fail_json(msg=CONFIG_FAIL_MSG)
try:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profiles.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profiles.py
index 60b436a29..554a44656 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profiles.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_server_interface_profiles.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -99,7 +99,7 @@ options:
type: int
default: 120
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Jagadeesh N V (@jagadeeshnv)"
notes:
- This module supports C(check_mode).
@@ -193,10 +193,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import \
get_rest_items, strip_substr_dict, job_tracking, apply_diff_key
@@ -397,8 +396,8 @@ def main():
}},
"job_wait": {"type": 'bool', "default": True},
"job_wait_timeout": {"type": 'int', "default": 120}}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[
('device_id', 'device_service_tag',)],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_session.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_session.py
new file mode 100644
index 000000000..8560b7220
--- /dev/null
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_session.py
@@ -0,0 +1,408 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+#
+# Dell OpenManage Ansible Modules
+# Version 9.3.0
+# Copyright (C) 2024 Dell Inc. or its subsidiaries. All Rights Reserved.
+
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+#
+
+
+from __future__ import (absolute_import, division, print_function)
+
+__metaclass__ = type
+
+DOCUMENTATION = r"""
+---
+module: ome_session
+short_description: Manage OpenManage Enterprise and OpenManage Enterprise modular sessions
+version_added: "9.3.0"
+description:
+ - This module allows you to create and delete sessions on OpenManage Enterprise and OpenManage Enterprise Modular.
+options:
+ hostname:
+ description:
+ - IP address or hostname of the OpenManage Enterprise.
+ type: str
+ username:
+ description:
+ - Username of the OpenManage Enterprise. If the username is not provided, then
+ the environment variable E(OME_USERNAME) is used.
+ - I(username) is required when I(state) is C(present).
+ type: str
+ password:
+ description:
+ - Password of the OpenManage Enterprise. If the password is not provided, then
+ the environment variable E(OME_PASSWORD) is used.
+ - I(password) is required when I(state) is C(present).
+ type: str
+ port:
+ description:
+ - Port of the OpenManage Enterprise.
+ type: int
+ default: 443
+ validate_certs:
+ description:
+ - If C(false), the SSL certificates will not be validated.
+ - Configure C(false) only on personally controlled sites where self-signed certificates are used.
+ type: bool
+ default: true
+ ca_path:
+ description:
+ - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.
+ type: path
+ timeout:
+ description:
+ - The HTTPS socket level timeout in seconds.
+ type: int
+ default: 30
+ state:
+ description:
+ - The state of the session in OpenManage Enterprise.
+ - C(present) creates a session.
+ - C(absent) deletes a session.
+ - Module will always report changes found to be applied when I(state) is C(present).
+ choices: [present, absent]
+ type: str
+ default: present
+ x_auth_token:
+ description:
+ - Authentication token.
+ - I(x_auth_token) is required when I(state) is C(absent).
+ type: str
+ aliases: ['auth_token']
+ session_id:
+ description:
+ - Session ID of the OpenManage Enterprise.
+ - I(session_id) is required when I(state) is C(absent).
+ type: str
+requirements:
+ - "python >= 3.9.6"
+author:
+ - "Kritika Bhateja (@Kritika-Bhateja-03)"
+notes:
+ - Run this module from a system that has direct access to Dell OpenManage Enterprise.
+ - This module supports IPv4 and IPv6 addresses.
+ - This module supports C(check_mode).
+ - This module will always report changes found to be applied when I(state) is C(present).
+"""
+
+EXAMPLES = r"""
+---
+- name: Create a session
+ dellemc.openmanage.ome_session:
+ hostname: 198.162.0.1
+ username: username
+ password: password
+ ca_path: "/path/to/ca_cert.pem"
+ state: present
+
+- name: Delete a session
+ dellemc.openmanage.ome_session:
+ hostname: 198.162.0.1
+ ca_path: "/path/to/ca_cert.pem"
+ state: absent
+ x_auth_token: aed4aa802b748d2f3b31deec00a6b28a
+ session_id: 4b48e9ab-809e-4087-b7c4-201a16e0143d
+
+- name: Create a session and execute other modules
+ block:
+ - name: Create a session
+ dellemc.openmanage.ome_session:
+ hostname: 198.162.0.1
+ username: username
+ password: password
+ ca_path: "/path/to/ca_cert.pem"
+ state: present
+ register: authData
+
+ - name: Call ome_user_info module
+ dellemc.openmanage.ome_user_info:
+ hostname: 198.162.0.1
+ ca_path: "/path/to/ca_cert.pem"
+ x_auth_token: "{{ authData.x_auth_token }}"
+
+ - name: Call ome_network_vlan_info module
+ dellemc.openmanage.ome_network_vlan_info:
+ hostname: 198.162.0.1
+ ca_path: "/path/to/ca_cert.pem"
+ x_auth_token: "{{ authData.x_auth_token }}"
+ always:
+ - name: Destroy a session
+ dellemc.openmanage.ome_session:
+ hostname: 198.162.0.1
+ ca_path: "/path/to/ca_cert.pem"
+ state: absent
+ x_auth_token: "{{ authData.x_auth_token }}"
+ session_id: "{{ authData.session_data.Id }}"
+"""
+
+RETURN = r'''
+---
+msg:
+ description: Status of the session operation.
+ returned: always
+ type: str
+ sample: "The session has been created successfully."
+session_data:
+ description: The session details.
+ returned: For session creation operation
+ type: dict
+ sample: {
+ "Id": "d5c28d8e-1084-4055-9c01-e1051cfee2dd",
+ "Description": "admin",
+ "Name": "API",
+ "UserName": "admin",
+ "UserId": 10078,
+ "Password": null,
+ "Roles": [
+ "BACKUP_ADMINISTRATOR"
+ ],
+ "IpAddress": "100.198.162.0",
+ "StartTimeStamp": "2023-07-03 07:22:43.683",
+ "LastAccessedTimeStamp": "2023-07-03 07:22:43.683",
+ "DirectoryGroup": []
+ }
+x_auth_token:
+ description: Authentication token.
+ returned: For session creation operation
+ type: str
+ sample: "d15f17f01cd627c30173b1582642497d"
+error_info:
+ description: Details of the HTTP Error.
+ returned: On HTTP error
+ type: dict
+ sample: {
+ "error": {
+ "@Message.ExtendedInfo": [
+ {
+ "Message": "Unable to complete the operation because an invalid username and/or password is entered, and therefore authentication failed.",
+ "MessageArgs": [],
+ "MessageArgs@odata.count": 0,
+ "MessageId": "IDRAC.2.7.SYS415",
+ "RelatedProperties": [],
+ "RelatedProperties@odata.count": 0,
+ "Resolution": "Enter valid user name and password and retry the operation.",
+ "Severity": "Warning"
+ }
+ ],
+ "code": "Base.1.12.GeneralError",
+ "message": "A general error has occurred. See ExtendedInfo for more information"
+ }
+ }
+'''
+
+
+import json
+from urllib.error import HTTPError, URLError
+from ansible_collections.dellemc.openmanage.plugins.module_utils.session_utils import Session
+from ansible.module_utils.basic import AnsibleModule
+from ansible.module_utils.urls import ConnectionError, SSLValidationError
+from ansible.module_utils.common.parameters import env_fallback
+from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import remove_key
+
+SESSION_URL = "/api/SessionService/Sessions"
+ODATA = "@odata.id"
+ODATA_REGEX = "(.*?)@odata"
+
+CREATE_SUCCESS_MSG = "The session has been created successfully."
+DELETE_SUCCESS_MSG = "The session has been deleted successfully."
+FAILURE_MSG = "Unable to '{operation}' a session."
+CHANGES_FOUND_MSG = "Changes found to be applied."
+NO_CHANGES_FOUND_MSG = "No changes found to be applied."
+
+
+class OMESession(Session):
+ def __init__(self, module):
+ super().__init__(module)
+ self.url_kwrags = {"force_basic_auth": True,
+ "url_username": self.module.params.get("username"),
+ "url_password": self.module.params.get("password")}
+
+ def get_session_status(self, session_url, session_id):
+ """
+ Retrieves the status of a session given its URL and ID.
+
+ Args:
+ session_url (str): The URL of the session.
+ session_id (str): The ID of the session.
+
+ Returns:
+ int: The status code of the session status response. If an HTTPError occurs, the status
+ code of the error is returned.
+ """
+ session_status_response = self.instance.invoke_request(SESSION_URL, "GET")
+ sessions_data = session_status_response.json_data
+ session_ids = [session_id["@odata.id"].split("'")[1] for session_id in sessions_data["value"]]
+ session_status = session_id in session_ids
+ return session_status
+
+ def create_session(self):
+ """
+ Executes the session creation process.
+
+ This function creates a session by sending a POST request to the session URL with the
+ provided username and password.
+ If the request is successful (status code 201), it retrieves the session details, removes
+ any OData keys from the response,
+ and extracts the X-Auth-Token from the response headers. It then exits the module with a
+ success message, indicating that
+ the session was created successfully, and provides the session data and X-Auth-Token as
+ output variables.
+
+ If the request fails (status code other than 201), it exits the module with a failure
+ message, indicating that the session creation failed.
+
+ Parameters:
+ None
+
+ Returns:
+ None
+ """
+ payload = {"UserName": self.module.params.get("username"),
+ "Password": self.module.params.get("password")}
+ if self.module.check_mode:
+ self.module.exit_json(msg=CHANGES_FOUND_MSG, changed=True)
+ session_response = self.instance.invoke_request(SESSION_URL, "POST", data=payload, url_kwargs=self.url_kwrags)
+ status = session_response.status_code
+ if status == 201:
+ session_details = session_response.json_data
+ session_data = remove_key(session_details, regex_pattern=ODATA_REGEX)
+ x_auth_token = session_response.headers.get('X-Auth-Token')
+ self.module.exit_json(msg=CREATE_SUCCESS_MSG,
+ changed=True,
+ session_data=session_data,
+ x_auth_token=x_auth_token)
+ else:
+ self.module.exit_json(msg=FAILURE_MSG.format(operation="create"), failed=True)
+
+ def delete_session(self):
+ """
+ Executes the deletion of a session.
+ This function retrieves the session ID from the module parameters.It then invokes a
+ DELETE request to the session URL with the session ID appended. The response from
+ the request is stored in the `session_response` variable.
+
+ If the response status code is 200, indicating a successful deletion, the function exits
+ the module with a success message and sets the `changed` parameter to True. Otherwise, it
+ exits the module with a failure message and sets the `failed` parameter to True.
+
+ Parameters:
+ None
+
+ Returns:
+ None
+ """
+ session_id = self.module.params.get("session_id")
+ session_status = self.get_session_status(SESSION_URL, session_id)
+ if self.module.check_mode:
+ if session_status:
+ self.module.exit_json(msg=CHANGES_FOUND_MSG, changed=True)
+ else:
+ self.module.exit_json(msg=NO_CHANGES_FOUND_MSG)
+ else:
+ if session_status:
+ try:
+ delete_session_url = SESSION_URL + "('" + session_id + "')"
+ session_response = self.instance.invoke_request(delete_session_url, "DELETE")
+ status = session_response.status_code
+ if status == 204:
+ self.module.exit_json(msg=DELETE_SUCCESS_MSG, changed=True)
+ except HTTPError as err:
+ filter_err = remove_key(json.load(err), regex_pattern=ODATA_REGEX)
+ self.module.exit_json(msg=FAILURE_MSG.format(operation="delete"),
+ error_info=filter_err,
+ failed=True)
+ else:
+ self.module.exit_json(msg=NO_CHANGES_FOUND_MSG)
+
+
+def main():
+ """
+ Main function that initializes the Ansible module with the argument specs and required if
+ conditions.
+ It then creates a SessionAPI object with the module parameters and performs a session operation
+ based on the state parameter.
+ If the state is "present", it creates a CreateSession object and executes it. If the state is
+ "absent", it creates a DeleteSession object and executes it.
+ The session status is returned.
+
+ Raises:
+ HTTPError: If an HTTP error occurs, the error message and filtered error information are
+ returned in the module's exit_json.
+ URLError: If a URL error occurs, the error message is returned in the module's exit_json.
+ SSLValidationError, ConnectionError, TypeError, ValueError, OSError: If any other error
+ occurs, the error message is returned in the module's exit_json.
+
+ Returns:
+ None
+ """
+ specs = get_argument_spec()
+ module = AnsibleModule(
+ argument_spec=specs,
+ required_if=[
+ ["state", "present", ("username", "password",)],
+ ["state", "absent", ("x_auth_token", "session_id",)]
+ ],
+ supports_check_mode=True
+ )
+ try:
+ ome = OMESession(module)
+ session_operation = module.params.get("state")
+ if session_operation == "present":
+ ome.create_session()
+ else:
+ ome.delete_session()
+ except HTTPError as err:
+ filter_err = {}
+ if isinstance(err, dict):
+ filter_err = remove_key(json.load(err), regex_pattern=ODATA_REGEX)
+ module.exit_json(msg=str(err), error_info=filter_err, failed=True)
+ except URLError as err:
+ module.exit_json(msg=str(err), unreachable=True)
+ except (SSLValidationError, ConnectionError, TypeError, ValueError, OSError) as err:
+ module.exit_json(msg=str(err), failed=True)
+
+
+def get_argument_spec():
+ """
+ Returns a dictionary representing the argument specification for a module.
+
+ The dictionary contains the following keys and their corresponding values:
+ - "hostname": A string representing the hostname.
+ - "username": A string representing the username. It has a fallback option to retrieve the
+ value from the environment variable 'IDRAC_USERNAME'.
+ - "password": A string representing the password. It is marked as not to be logged and has a
+ fallback option to retrieve the value from the environment variable 'IDRAC_PASSWORD'.
+ - "port": An integer representing the port number. The default value is 443.
+ - "validate_certs": A boolean representing whether to validate certificates. The default value
+ is True.
+ - "ca_path": A path representing the certificate authority path. The default value is None.
+ - "timeout": An integer representing the timeout value. The default value is 30.
+ - "state": A string representing the state. The default value is "present". The choices are
+ ["present", "absent"].
+ - "x_auth_token": A string representing the authentication token. It is marked as not to be
+ logged.
+ - "session_id": A string representing the session ID.
+
+ Returns:
+ A dictionary representing the argument specification.
+ """
+ return {
+ "hostname": {"type": "str"},
+ "username": {"type": "str", "fallback": (env_fallback, ['OME_USERNAME'])},
+ "password": {"type": "str", "no_log": True, "fallback": (env_fallback, ['OME_PASSWORD'])},
+ "port": {"type": "int", "default": 443},
+ "validate_certs": {"type": "bool", "default": True},
+ "ca_path": {"type": "path", "default": None},
+ "timeout": {"type": "int", "default": 30},
+ "state": {"type": 'str', "default": "present", "choices": ["present", "absent"]},
+ "x_auth_token": {"type": "str", "no_log": True, "aliases": ['auth_token']},
+ "session_id": {"type": "str"}
+ }
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric.py
index 2e790fc08..96e947182 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -75,7 +75,7 @@ options:
to represent the entire fabric. Enable this feature only when connecting to such a solution."
choices: ['Enabled', 'Disabled']
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Sajna Shetty(@Sajna-Shetty)"
notes:
@@ -179,8 +179,7 @@ error_info:
import json
import socket
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ssl import SSLError
@@ -711,8 +710,8 @@ def main():
"secondary_switch_service_tag": {"required": False, "type": "str"},
"override_LLDP_configuration": {"required": False, "type": "str", "choices": ['Enabled', 'Disabled']},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[['state', 'present', ('new_name', 'description', 'fabric_design', 'primary_switch_service_tag',
'secondary_switch_service_tag', 'override_LLDP_configuration',), True]],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_info.py
index 9ce352d5e..4433afbdf 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.1.0
-# Copyright (C) 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -570,8 +570,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import strip_substr_dict
@@ -655,8 +654,8 @@ def main():
"fabric_id": {"type": 'str', "required": False},
"fabric_name": {"type": 'str', "required": False}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[
('fabric_id', 'fabric_name')
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink.py
index 0ac1f2557..311a2596b 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -89,7 +89,7 @@ options:
description: Specify the name of the VLAN to be added as untagged to the uplink.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V(@jagadeeshnv)"
notes:
@@ -270,11 +270,10 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.common.dict_transformations import recursive_diff
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import get_item_and_list
FABRIC_URI = "NetworkService/Fabrics"
@@ -503,8 +502,8 @@ def main():
"tagged_networks": {"type": "list", "elements": "str"},
"untagged_network": {"type": "str"}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[['state', 'present',
('new_name', 'description', 'uplink_type', 'ufd_enable',
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink_info.py
index d6bb0683e..09daad9d3 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_smart_fabric_uplink_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.2.0
-# Copyright (C) 2022-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2022-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -186,10 +186,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import strip_substr_dict
ALL_UPLINKS_URI = "NetworkService/Fabrics('{0}')/Uplinks?$expand=Networks,Ports"
@@ -294,8 +293,8 @@ def main():
"uplink_id": {"type": "str"},
"uplink_name": {"type": "str"}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[('fabric_id', 'fabric_name'), ('uplink_id', 'uplink_name')],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template.py
index 6bf77ad02..29f851089 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.5.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -133,7 +133,7 @@ options:
- This option is applicable when I(job_wait) is C(true).
default: 1200
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V (@jagadeeshnv)"
- "Husniya Hameed (@husniya_hameed)"
@@ -546,8 +546,7 @@ error_info:
import json
import time
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import apply_diff_key, job_tracking
@@ -1016,8 +1015,8 @@ def main():
"job_wait": {"required": False, "type": "bool", "default": True},
"job_wait_timeout": {"required": False, "type": "int", "default": 1200}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_if=[
['command', 'create', ['attributes']],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_identity_pool.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_identity_pool.py
index 88a09ae95..2f21bda8d 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_identity_pool.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_identity_pool.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -34,7 +34,7 @@ options:
- This option is not applicable when detaching an identity pool from a template.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Felix Stephen (@felixs88)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -91,8 +91,7 @@ error_info:
'''
import json
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ssl import SSLError
@@ -157,8 +156,8 @@ def main():
"template_name": {"required": True, "type": "str"},
"identity_pool_name": {"required": False, "type": "str"},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
supports_check_mode=True
)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_info.py
index 9e91a5fb3..75ddc5ff5 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -34,7 +34,7 @@ options:
description: Filter records by the supported values.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Sajna Shetty(@Sajna-Shetty)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -105,8 +105,7 @@ template_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -131,8 +130,8 @@ def main():
"options": {"filter": {"type": 'str', "required": False}}
},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[['template_id', 'system_query_options']],
supports_check_mode=True
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan.py
index c9d0bd97d..b4dc386bc 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -91,7 +91,7 @@ options:
type: list
elements: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Jagadeesh N V(@jagadeeshnv)"
notes:
@@ -192,8 +192,7 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -421,8 +420,8 @@ def main():
"tagged_networks": {"required": False, "type": "list", "elements": "dict", "options": port_tagged_spec},
"propagate_vlan": {"type": "bool", "default": True}
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
required_one_of=[("template_id", "template_name"),
("untagged_networks", "tagged_networks")],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan_info.py
index b91a6a946..c2b4d2a32 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_template_network_vlan_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.2.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -133,10 +133,9 @@ error_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
NETWORK_HIERARCHY_VIEW = 4 # For Network hierarchy View in a Template
TEMPLATE_ATTRIBUTE_VIEW = "TemplateService/Templates({0})/Views({1})/AttributeViewDetails"
@@ -212,10 +211,9 @@ def main():
"template_id": {"type": 'int'},
"template_name": {"type": 'str'}
}
- argument_spec.update(ome_auth_params)
- module = AnsibleModule(argument_spec=argument_spec,
- mutually_exclusive=[('template_id', 'template_name')],
- supports_check_mode=True)
+ module = OmeAnsibleModule(argument_spec=argument_spec,
+ mutually_exclusive=[('template_id', 'template_name')],
+ supports_check_mode=True)
try:
templates = []
with RestOME(module.params, req_session=True) as rest_obj:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_user.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_user.py
index 27092a036..38f47dc25 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_user.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_user.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -53,7 +53,7 @@ options:
- >-
Refer OpenManage Enterprise API Reference Guide for more details.
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Sajna Shetty(@Sajna-Shetty)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -153,8 +153,7 @@ user_status:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -238,8 +237,8 @@ def main():
"name": {"required": False, "type": 'str'},
"attributes": {"required": False, "type": 'dict', "default": {}},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[['user_id', 'name'], ],
required_if=[['state', 'present', ['attributes']], ],
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/ome_user_info.py b/ansible_collections/dellemc/openmanage/plugins/modules/ome_user_info.py
index 488444694..7c9dd6fae 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/ome_user_info.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/ome_user_info.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -34,7 +34,7 @@ options:
description: Filter records for the supported values.
type: str
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author: "Jagadeesh N V (@jagadeeshnv)"
notes:
- Run this module from a system that has direct access to Dell OpenManage Enterprise.
@@ -98,8 +98,7 @@ user_info:
import json
from ssl import SSLError
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params
+from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, OmeAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -124,8 +123,8 @@ def main():
"filter": {"type": 'str', "required": False},
}},
}
- specs.update(ome_auth_params)
- module = AnsibleModule(
+
+ module = OmeAnsibleModule(
argument_spec=specs,
mutually_exclusive=[
('account_id', 'system_query_options')
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_event_subscription.py b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_event_subscription.py
index c974aaccc..0eec0b55b 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_event_subscription.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_event_subscription.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2021-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+
# see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt
@@ -55,7 +55,7 @@ options:
default: present
choices: ["present", "absent"]
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Trevor Squillario (@TrevorSquillario)"
- "Sachin Apagundi (@sachin-apa)"
@@ -197,8 +197,7 @@ error_info:
import json
import os
from ssl import SSLError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params
-from ansible.module_utils.basic import AnsibleModule
+from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, RedfishAnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -291,9 +290,8 @@ def main():
"choices": ['Event', 'MetricReport']},
"state": {"type": "str", "default": "present", "choices": ['present', 'absent']},
}
- specs.update(redfish_auth_params)
- module = AnsibleModule(
+ module = RedfishAnsibleModule(
argument_spec=specs,
supports_check_mode=True)
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware.py b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware.py
index 98f64f780..a135198fd 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2019-2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -50,7 +50,7 @@ options:
I(job_wait_time) minimum or make I(job_wait)as false and retrigger."
default: 3600
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
- "urllib3"
author:
- "Felix Stephen (@felixs88)"
@@ -144,8 +144,8 @@ import json
import os
import time
from ssl import SSLError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params
-from ansible.module_utils.basic import AnsibleModule, missing_required_lib
+from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, RedfishAnsibleModule
+from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -271,8 +271,8 @@ def main():
"job_wait": {"required": False, "type": 'bool', "default": True},
"job_wait_timeout": {"required": False, "type": "int", "default": 3600}
}
- specs.update(redfish_auth_params)
- module = AnsibleModule(
+
+ module = RedfishAnsibleModule(
argument_spec=specs,
supports_check_mode=False)
if not HAS_LIB:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware_rollback.py b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware_rollback.py
index ef93d669f..1779b89b0 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware_rollback.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_firmware_rollback.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 8.2.0
-# Copyright (C) 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2023-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -144,11 +144,10 @@ import json
import re
import time
from ssl import SSLError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params, \
+from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, RedfishAnsibleModule, \
SESSION_RESOURCE_COLLECTION
from ansible_collections.dellemc.openmanage.plugins.module_utils.utils import wait_for_redfish_reboot_job, \
wait_for_redfish_job_complete, strip_substr_dict, MANAGER_JOB_ID_URI, RESET_UNTRACK, MANAGERS_URI, RESET_SUCCESS
-from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import ConnectionError, SSLValidationError
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
@@ -324,8 +323,8 @@ def main():
"reboot": {"type": "bool", "default": True},
"reboot_timeout": {"type": "int", "default": 900},
}
- specs.update(redfish_auth_params)
- module = AnsibleModule(argument_spec=specs, supports_check_mode=True)
+
+ module = RedfishAnsibleModule(argument_spec=specs, supports_check_mode=True)
if module.params["reboot_timeout"] <= 0:
module.fail_json(msg=NEGATIVE_TIMEOUT_MESSAGE)
try:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_powerstate.py b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_powerstate.py
index 085bbc018..a361f7b34 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_powerstate.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_powerstate.py
@@ -3,8 +3,8 @@
#
# Dell OpenManage Ansible Modules
-# Version 7.0.0
-# Copyright (C) 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Version 9.3.0
+# Copyright (C) 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
@@ -51,7 +51,7 @@ options:
choices: ["ForceOff", "ForceOn", "ForceRestart", "GracefulRestart", "GracefulShutdown",
"Nmi", "On", "PowerCycle", "PushPowerButton"]
requirements:
- - "python >= 3.8.6"
+ - "python >= 3.9.6"
author:
- "Sajna Shetty(@Sajna-Shetty)"
notes:
@@ -118,8 +118,7 @@ error_info:
import json
import re
from ssl import SSLError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params
-from ansible.module_utils.basic import AnsibleModule
+from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, RedfishAnsibleModule
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError
@@ -241,9 +240,7 @@ def main():
"choices": ['ForceOff', 'ForceOn', 'ForceRestart', 'GracefulRestart',
'GracefulShutdown', 'Nmi', 'On', 'PowerCycle', 'PushPowerButton']},
}
- specs.update(redfish_auth_params)
-
- module = AnsibleModule(
+ module = RedfishAnsibleModule(
argument_spec=specs,
supports_check_mode=True)
try:
diff --git a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_storage_volume.py b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_storage_volume.py
index 3de200a8f..25360bece 100644
--- a/ansible_collections/dellemc/openmanage/plugins/modules/redfish_storage_volume.py
+++ b/ansible_collections/dellemc/openmanage/plugins/modules/redfish_storage_volume.py
@@ -3,7 +3,7 @@
#
# Dell OpenManage Ansible Modules
-# Version 9.1.0
+# Version 9.3.0
# Copyright (C) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -374,8 +374,7 @@ error_info:
import json
import copy
from ssl import SSLError
-from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params
-from ansible.module_utils.basic import AnsibleModule
+from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, RedfishAnsibleModule
from ansible.module_utils.compat.version import LooseVersion
from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError
from ansible.module_utils.urls import ConnectionError, SSLValidationError
@@ -945,10 +944,7 @@ def main():
"job_wait": {"required": False, "type": "bool", "default": False},
"job_wait_timeout": {"required": False, "type": "int", "default": 1200}
}
-
- specs.update(redfish_auth_params)
-
- module = AnsibleModule(
+ module = RedfishAnsibleModule(
argument_spec=specs,
mutually_exclusive=[['state', 'command'], ['volume_type', 'raid_type']],
required_one_of=[['state', 'command']],