diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7dce06924..d62e943af 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,38 @@ Dell EMC OpenManage Ansible Modules Release Notes .. contents:: Topics +v5.0.1 +====== + +Release Summary +--------------- + +Support to provide custom or organizational CA signed certificate for SSL validation from the environment variable. + +Major Changes +------------- + +- All modules can read custom or organizational CA signed certificate from the environment variables. Please refer to `SSL Certificate Validation `_ section in the `README.md `_ for modification to existing playbooks or setting environment variable. + +Bugfixes +-------- + +- All playbooks require modification because the validate_certs argument is set to True by default (https://github.com/dell/dellemc-openmanage-ansible-modules/issues/357) +- The ome_application_network_time and ome_application_network_proxy modules are breaking due to the changes introduced for SSL validation.(https://github.com/dell/dellemc-openmanage-ansible-modules/issues/360) + +Known Issues +------------ + +- idrac_user - Issue(192043) The module may error out with the message ``unable to perform the import or export operation because there are pending attribute changes or a configuration job is in progress``. Wait for the job to complete and run the task again. +- ome_application_alerts_smtp - Issue(212310) - The module does not provide a proper error message if the destination_address is more than 255 characters. +- ome_application_alerts_syslog - Issue(215374) - The module does not provide a proper error message if the destination_address is more than 255 characters. +- ome_device_local_access_configuration - Issue(215035) - The module reports ``Successfully updated the local access setting`` if an unsupported value is provided for the parameter timeout_limit. However, this value is not actually applied on OpenManage Enterprise Modular. +- ome_device_local_access_configuration - Issue(217865) - The module does not display a proper error message if an unsupported value is provided for the user_defined and lcd_language parameters. +- ome_device_network_services - Issue(212681) - The module does not provide a proper error message if unsupported values are provided for the parameters- port_number, community_name, max_sessions, max_auth_retries, and idle_timeout. +- ome_device_power_settings - Issue(212679) - The module errors out with the following message if the value provided for the parameter ``power_cap`` is not within the supported range of 0 to 32767, ``Unable to complete the request because PowerCap does not exist or is not applicable for the resource URI.`` +- ome_device_quick_deploy - Issue(216352) - The module does not display a proper error message if an unsupported value is provided for the ipv6_prefix_length and vlan_id parameters. +- ome_smart_fabric_uplink - Issue(186024) - The module does not allow the creation of multiple uplinks of the same name even though it is supported by OpenManage Enterprise Modular. If an uplink is created using the same name as an existing uplink, the existing uplink is modified. + v5.0.0 ====== diff --git a/README.md b/README.md index ff87ceca9..16fa862eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dell EMC OpenManage Ansible Modules -Dell EMC OpenManage Ansible Modules allows data center and IT administrators to use RedHat Ansible to automate and orchestrate the configuration, deployment, and update of Dell EMC PowerEdge Servers and modular infrastructure by leveraging the management automation capabilities in-built into the Integrated Dell Remote Access Controller (iDRAC), OpenManage Enterprise and OpenManage Enterprise Modular. +Dell EMC OpenManage Ansible Modules allows data center and IT administrators to use RedHat Ansible to automate and orchestrate the configuration, deployment, and update of Dell EMC PowerEdge Servers and modular infrastructure by leveraging the management automation capabilities in-built into the Integrated Dell Remote Access Controller (iDRAC), OpenManage Enterprise (OME) and OpenManage Enterprise Modular (OMEM). OpenManage Ansible Modules simplifies and automates provisioning, deployment, and updates of PowerEdge servers and modular infrastructure. It allows system administrators and software developers to introduce the physical infrastructure provisioning into their software provisioning stack, integrate with existing DevOps pipelines and manage their infrastructure using version-controlled playbooks, server configuration profiles, and templates in line with the Infrastructure-as-Code (IaC) principles. @@ -8,8 +8,8 @@ OpenManage Ansible Modules simplifies and automates provisioning, deployment, an * iDRAC 7 based Dell EMC PowerEdge Servers with firmware versions 2.63.60.62 and above. * iDRAC 8 based Dell EMC PowerEdge Servers with firmware versions 2.81.81.81 and above. * iDRAC 9 based Dell EMC PowerEdge Servers with firmware versions 5.00.10.20 and above. - * Dell EMC OpenManage Enterprise versions 3.8.0 and above. - * Dell EMC OpenManage Enterprise-Modular versions 1.30.10 and above. + * Dell EMC OpenManage Enterprise versions 3.8.2 and above. + * Dell EMC OpenManage Enterprise Modular versions 1.40.00 and above. ## Prerequisites * [Ansible >= 2.10.0](https://github.com/ansible/ansible) @@ -42,11 +42,15 @@ To enable SSL certificate validation, perform the following steps: * Generate and upload the custom or organizational CA signed certificates on the iDRACs, OpenManage Enterprise, and OpenManage Enterprise-Modular, as required. * For iDRAC, see the section `SSL server certificates` in the `Integrated Dell Remote Access Controller Users Guide`. * For OpenManage Enterprise, see the section `Security Certificates` in the `OpenManage Enterprise Users Guide`. - * For OpenManage Enterprise-Modular Edition, see the section `Managing certificates` in the `OpenManage Enterprise-Modular Edition for PowerEdge MX7000 Chassis Users Guide`. + * For OpenManage Enterprise Modular, see the section `Managing certificates` in the `OpenManage Enterprise Modular for PowerEdge MX7000 Chassis Users Guide`. * After you have uploaded the custom or organizational CA signed certificate to iDRAC or OME or OME-M, you must have the CA file or bundle available on your Ansible controller. For example, copy the CA file or bundle in the following path: /usr/share/ssl-certs/ > **_NOTE_**: Ensure that the user running the Ansible modules has permission to access the certificate file or bundle. - * In your playbook, set the ca_path argument to the file path of your custom or organization CA certificate file or bundle. + * You can then use either of the following methods to specify the custom or organization CA certificate file or bundle path to the module: + * In your playbook tasks, set the `ca_path` argument to the file path of your custom or organization CA certificate file or bundle. ```ca_path: /usr/share/ssl-certs/ca-cert.pem``` + * Use any of the following environment variables to specify the custom or organization CA certificate file or bundle path. The modules reads the environment variable in the following order of preference: ```REQUESTS_CA_BUNDLE```, ```CURL_CA_BUNDLE```, ```OMAM_CA_BUNDLE```. + > **_NOTE_**: Use the following command to set the environment variable with the custom or organization CA certificate file or bundle: +
```export REQUESTS_CA_BUNDLE=/usr/share/ssl-certs/ca-cert.pem``` ### Ignore SSL certificate validation It is common to run a test environment without a proper SSL certificate configuration. To disable the certificate validation for a module, set the validate_certs module argument to ```False``` in the playbook. @@ -88,4 +92,4 @@ To debug OpenManage Ansible Modules using IDE, see [here](https://github.com/del * To provide feedback to the development team, send an email to **OpenManageAnsible@Dell.com**. ## Authors - * OpenManageAnsible (OpenManageAnsible@dell.com) + * OpenManageAnsible (OpenManageAnsible@dell.com) \ No newline at end of file diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 2d059c694..e3a0c5a42 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -529,3 +529,44 @@ releases: name: ome_device_quick_deploy namespace: '' release_date: '2022-01-27' + 5.0.1: + changes: + major_changes: + - All modules can read custom or organizational CA signed certificate from the environment variables. + Please refer to `SSL Certificate Validation `_ section in the `README.md `_ for modification to existing playbooks or setting environment variable. + bugfixes: + - The ome_application_network_time and ome_application_network_proxy modules are breaking due + to the changes introduced for SSL validation.(https://github.com/dell/dellemc-openmanage-ansible-modules/issues/360) + - All playbooks require modification because the validate_certs argument is set to True by default + (https://github.com/dell/dellemc-openmanage-ansible-modules/issues/357) + known_issues: + - ome_device_quick_deploy - Issue(216352) - The module does not display a proper error message + if an unsupported value is provided for the ipv6_prefix_length and vlan_id parameters. + - ome_device_local_access_configuration - Issue(217865) - The module does not + display a proper error message if an unsupported value is provided for the + user_defined and lcd_language parameters. + - ome_device_local_access_configuration - Issue(215035) - The module reports + ``Successfully updated the local access setting`` if an unsupported value is + provided for the parameter timeout_limit. However, this value is not + actually applied on OpenManage Enterprise Modular. + - ome_device_network_services - Issue(212681) - The module does not provide a + proper error message if unsupported values are provided for the parameters- + port_number, community_name, max_sessions, max_auth_retries, and idle_timeout. + - ome_application_alerts_syslog - Issue(215374) - The module does not provide a + proper error message if the destination_address is more than 255 characters. + - ome_application_alerts_smtp - Issue(212310) - The module does not provide a + proper error message if the destination_address is more than 255 characters. + - idrac_user - Issue(192043) The module may error out with the message ``unable + to perform the import or export operation because there are pending attribute + changes or a configuration job is in progress``. Wait for the job to complete + and run the task again. + - ome_smart_fabric_uplink - Issue(186024) - The module does not allow the creation + of multiple uplinks of the same name even though it is supported by OpenManage + Enterprise Modular. If an uplink is created using the same name as an existing + uplink, the existing uplink is modified. + - ome_device_power_settings - Issue(212679) - The module errors out with the + following message if the value provided for the parameter ``power_cap`` is + not within the supported range of 0 to 32767, ``Unable to complete the request + because PowerCap does not exist or is not applicable for the resource URI.`` + release_summary: Support to provide custom or organizational CA signed certificate for SSL validation from the environment variable. + release_date: '2022-02-11' \ No newline at end of file diff --git a/docs/modules/dellemc_configure_idrac_eventing.rst b/docs/modules/dellemc_configure_idrac_eventing.rst index 189b311e7..cd0f1cecd 100644 --- a/docs/modules/dellemc_configure_idrac_eventing.rst +++ b/docs/modules/dellemc_configure_idrac_eventing.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -127,8 +127,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/dellemc_configure_idrac_services.rst b/docs/modules/dellemc_configure_idrac_services.rst index 142e4708f..b926bcd50 100644 --- a/docs/modules/dellemc_configure_idrac_services.rst +++ b/docs/modules/dellemc_configure_idrac_services.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -55,8 +55,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - share_name (True, str, None) Network share or a local path. diff --git a/docs/modules/dellemc_get_firmware_inventory.rst b/docs/modules/dellemc_get_firmware_inventory.rst index 6b511105b..14b844316 100644 --- a/docs/modules/dellemc_get_firmware_inventory.rst +++ b/docs/modules/dellemc_get_firmware_inventory.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -55,8 +55,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/dellemc_get_system_inventory.rst b/docs/modules/dellemc_get_system_inventory.rst index e96c33222..3babb0325 100644 --- a/docs/modules/dellemc_get_system_inventory.rst +++ b/docs/modules/dellemc_get_system_inventory.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -55,8 +55,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/dellemc_idrac_lc_attributes.rst b/docs/modules/dellemc_idrac_lc_attributes.rst index 4c8576e93..08222c335 100644 --- a/docs/modules/dellemc_idrac_lc_attributes.rst +++ b/docs/modules/dellemc_idrac_lc_attributes.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -75,8 +75,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/dellemc_idrac_storage_volume.rst b/docs/modules/dellemc_idrac_storage_volume.rst index 8a683b692..d15aee678 100644 --- a/docs/modules/dellemc_idrac_storage_volume.rst +++ b/docs/modules/dellemc_idrac_storage_volume.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -139,8 +139,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/dellemc_system_lockdown_mode.rst b/docs/modules/dellemc_system_lockdown_mode.rst index 1422fa1af..29c44cefb 100644 --- a/docs/modules/dellemc_system_lockdown_mode.rst +++ b/docs/modules/dellemc_system_lockdown_mode.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -75,8 +75,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_bios.rst b/docs/modules/idrac_bios.rst index 1ba068581..85aa024f2 100644 --- a/docs/modules/idrac_bios.rst +++ b/docs/modules/idrac_bios.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -125,8 +125,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_firmware.rst b/docs/modules/idrac_firmware.rst index ae3fe1d6a..99c5f147a 100644 --- a/docs/modules/idrac_firmware.rst +++ b/docs/modules/idrac_firmware.rst @@ -26,7 +26,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -107,8 +107,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_firmware_info.rst b/docs/modules/idrac_firmware_info.rst index bbf218734..b6eda6ae4 100644 --- a/docs/modules/idrac_firmware_info.rst +++ b/docs/modules/idrac_firmware_info.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -55,8 +55,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_lifecycle_controller_job_status_info.rst b/docs/modules/idrac_lifecycle_controller_job_status_info.rst index eb55fcd95..6b4cfd4ed 100644 --- a/docs/modules/idrac_lifecycle_controller_job_status_info.rst +++ b/docs/modules/idrac_lifecycle_controller_job_status_info.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -59,8 +59,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_lifecycle_controller_jobs.rst b/docs/modules/idrac_lifecycle_controller_jobs.rst index 10ff99fbc..79bb43b2a 100644 --- a/docs/modules/idrac_lifecycle_controller_jobs.rst +++ b/docs/modules/idrac_lifecycle_controller_jobs.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -61,8 +61,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_lifecycle_controller_logs.rst b/docs/modules/idrac_lifecycle_controller_logs.rst index 5385cf23a..f2d20a24b 100644 --- a/docs/modules/idrac_lifecycle_controller_logs.rst +++ b/docs/modules/idrac_lifecycle_controller_logs.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -73,8 +73,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_lifecycle_controller_status_info.rst b/docs/modules/idrac_lifecycle_controller_status_info.rst index a7e319cdc..9757ab8e0 100644 --- a/docs/modules/idrac_lifecycle_controller_status_info.rst +++ b/docs/modules/idrac_lifecycle_controller_status_info.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -55,8 +55,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_network.rst b/docs/modules/idrac_network.rst index acdda7f86..22fbc4fbc 100644 --- a/docs/modules/idrac_network.rst +++ b/docs/modules/idrac_network.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -147,8 +147,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_os_deployment.rst b/docs/modules/idrac_os_deployment.rst index 3ba945b5f..b3a18dce8 100644 --- a/docs/modules/idrac_os_deployment.rst +++ b/docs/modules/idrac_os_deployment.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -75,8 +75,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_redfish_storage_controller.rst b/docs/modules/idrac_redfish_storage_controller.rst index 0c61a9550..f5715dbb8 100644 --- a/docs/modules/idrac_redfish_storage_controller.rst +++ b/docs/modules/idrac_redfish_storage_controller.rst @@ -112,8 +112,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_reset.rst b/docs/modules/idrac_reset.rst index d51187f1e..867287018 100644 --- a/docs/modules/idrac_reset.rst +++ b/docs/modules/idrac_reset.rst @@ -22,7 +22,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -57,8 +57,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_server_config_profile.rst b/docs/modules/idrac_server_config_profile.rst index 8ed835efa..316d86149 100644 --- a/docs/modules/idrac_server_config_profile.rst +++ b/docs/modules/idrac_server_config_profile.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -129,8 +129,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_syslog.rst b/docs/modules/idrac_syslog.rst index 9beaf90dc..31d69bd37 100644 --- a/docs/modules/idrac_syslog.rst +++ b/docs/modules/idrac_syslog.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -59,8 +59,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_system_info.rst b/docs/modules/idrac_system_info.rst index bbf2a87f2..9d0bade41 100644 --- a/docs/modules/idrac_system_info.rst +++ b/docs/modules/idrac_system_info.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -55,8 +55,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_timezone_ntp.rst b/docs/modules/idrac_timezone_ntp.rst index 91562e742..2623f9feb 100644 --- a/docs/modules/idrac_timezone_ntp.rst +++ b/docs/modules/idrac_timezone_ntp.rst @@ -20,7 +20,7 @@ Requirements ------------ The below requirements are needed on the host that executes this module. -- omsdk +- omsdk >= 1.2.488 - python >= 3.8.6 @@ -75,8 +75,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/idrac_user.rst b/docs/modules/idrac_user.rst index e2fc966cf..e404582b8 100644 --- a/docs/modules/idrac_user.rst +++ b/docs/modules/idrac_user.rst @@ -136,8 +136,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_active_directory.rst b/docs/modules/ome_active_directory.rst index a34867461..c5ddad916 100644 --- a/docs/modules/ome_active_directory.rst +++ b/docs/modules/ome_active_directory.rst @@ -150,8 +150,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_alerts_smtp.rst b/docs/modules/ome_application_alerts_smtp.rst index 2956ffd84..2b34f1cdd 100644 --- a/docs/modules/ome_application_alerts_smtp.rst +++ b/docs/modules/ome_application_alerts_smtp.rst @@ -87,8 +87,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_alerts_syslog.rst b/docs/modules/ome_application_alerts_syslog.rst index 887ac9fb3..d741e1671 100644 --- a/docs/modules/ome_application_alerts_syslog.rst +++ b/docs/modules/ome_application_alerts_syslog.rst @@ -77,8 +77,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_certificate.rst b/docs/modules/ome_application_certificate.rst index d265e5f07..e4fbec1cc 100644 --- a/docs/modules/ome_application_certificate.rst +++ b/docs/modules/ome_application_certificate.rst @@ -90,8 +90,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_network_address.rst b/docs/modules/ome_application_network_address.rst index 8f18c813c..88fa5db0f 100644 --- a/docs/modules/ome_application_network_address.rst +++ b/docs/modules/ome_application_network_address.rst @@ -224,8 +224,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_network_proxy.rst b/docs/modules/ome_application_network_proxy.rst index d376dbe81..2c5d1bd04 100644 --- a/docs/modules/ome_application_network_proxy.rst +++ b/docs/modules/ome_application_network_proxy.rst @@ -92,8 +92,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_network_settings.rst b/docs/modules/ome_application_network_settings.rst index 33feae088..ab6302099 100644 --- a/docs/modules/ome_application_network_settings.rst +++ b/docs/modules/ome_application_network_settings.rst @@ -119,8 +119,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_network_time.rst b/docs/modules/ome_application_network_time.rst index 39e9f7303..6c884a154 100644 --- a/docs/modules/ome_application_network_time.rst +++ b/docs/modules/ome_application_network_time.rst @@ -92,8 +92,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_network_webserver.rst b/docs/modules/ome_application_network_webserver.rst index da6cffe8e..9add772b4 100644 --- a/docs/modules/ome_application_network_webserver.rst +++ b/docs/modules/ome_application_network_webserver.rst @@ -66,8 +66,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_application_security_settings.rst b/docs/modules/ome_application_security_settings.rst index b79a485e5..f99ca189f 100644 --- a/docs/modules/ome_application_security_settings.rst +++ b/docs/modules/ome_application_security_settings.rst @@ -122,8 +122,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_chassis_slots.rst b/docs/modules/ome_chassis_slots.rst index bc5940571..60463fe06 100644 --- a/docs/modules/ome_chassis_slots.rst +++ b/docs/modules/ome_chassis_slots.rst @@ -101,8 +101,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_configuration_compliance_baseline.rst b/docs/modules/ome_configuration_compliance_baseline.rst index 11b92d2b0..d4d2c53a7 100644 --- a/docs/modules/ome_configuration_compliance_baseline.rst +++ b/docs/modules/ome_configuration_compliance_baseline.rst @@ -132,8 +132,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_configuration_compliance_info.rst b/docs/modules/ome_configuration_compliance_info.rst index 7e5bd33ce..feeadd160 100644 --- a/docs/modules/ome_configuration_compliance_info.rst +++ b/docs/modules/ome_configuration_compliance_info.rst @@ -70,8 +70,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_device_group.rst b/docs/modules/ome_device_group.rst index ca9cdc7e2..d5fbfdb4c 100644 --- a/docs/modules/ome_device_group.rst +++ b/docs/modules/ome_device_group.rst @@ -111,8 +111,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_device_info.rst b/docs/modules/ome_device_info.rst index 53a93532c..1896725d1 100644 --- a/docs/modules/ome_device_info.rst +++ b/docs/modules/ome_device_info.rst @@ -83,8 +83,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_device_local_access_configuration.rst b/docs/modules/ome_device_local_access_configuration.rst index e16c034c7..0e9e2b7bf 100644 --- a/docs/modules/ome_device_local_access_configuration.rst +++ b/docs/modules/ome_device_local_access_configuration.rst @@ -187,8 +187,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_device_location.rst b/docs/modules/ome_device_location.rst index a95e9a82f..3d61a4f4e 100644 --- a/docs/modules/ome_device_location.rst +++ b/docs/modules/ome_device_location.rst @@ -94,8 +94,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_device_mgmt_network.rst b/docs/modules/ome_device_mgmt_network.rst index 3d42cb7d5..a60b09262 100644 --- a/docs/modules/ome_device_mgmt_network.rst +++ b/docs/modules/ome_device_mgmt_network.rst @@ -279,8 +279,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_device_network_services.rst b/docs/modules/ome_device_network_services.rst index 2283707fb..9d57373c2 100644 --- a/docs/modules/ome_device_network_services.rst +++ b/docs/modules/ome_device_network_services.rst @@ -123,8 +123,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_device_power_settings.rst b/docs/modules/ome_device_power_settings.rst index da23b1adc..46f75bb27 100644 --- a/docs/modules/ome_device_power_settings.rst +++ b/docs/modules/ome_device_power_settings.rst @@ -117,8 +117,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_device_quick_deploy.rst b/docs/modules/ome_device_quick_deploy.rst index 5b6f1a58c..0f32a4138 100644 --- a/docs/modules/ome_device_quick_deploy.rst +++ b/docs/modules/ome_device_quick_deploy.rst @@ -172,8 +172,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_diagnostics.rst b/docs/modules/ome_diagnostics.rst index 0e4ca42d3..834ffec4b 100644 --- a/docs/modules/ome_diagnostics.rst +++ b/docs/modules/ome_diagnostics.rst @@ -158,8 +158,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_discovery.rst b/docs/modules/ome_discovery.rst index a504538ac..79f68dd8f 100644 --- a/docs/modules/ome_discovery.rst +++ b/docs/modules/ome_discovery.rst @@ -434,8 +434,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_domain_user_groups.rst b/docs/modules/ome_domain_user_groups.rst index 106ed660e..29a8b20c6 100644 --- a/docs/modules/ome_domain_user_groups.rst +++ b/docs/modules/ome_domain_user_groups.rst @@ -100,8 +100,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_firmware.rst b/docs/modules/ome_firmware.rst index 11c26688f..4dcc4ae3b 100644 --- a/docs/modules/ome_firmware.rst +++ b/docs/modules/ome_firmware.rst @@ -129,8 +129,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_firmware_baseline.rst b/docs/modules/ome_firmware_baseline.rst index 31cdb15f9..673804ea8 100644 --- a/docs/modules/ome_firmware_baseline.rst +++ b/docs/modules/ome_firmware_baseline.rst @@ -126,8 +126,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_firmware_baseline_compliance_info.rst b/docs/modules/ome_firmware_baseline_compliance_info.rst index c82a7d4bf..80b4c5077 100644 --- a/docs/modules/ome_firmware_baseline_compliance_info.rst +++ b/docs/modules/ome_firmware_baseline_compliance_info.rst @@ -92,8 +92,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_firmware_baseline_info.rst b/docs/modules/ome_firmware_baseline_info.rst index 9b0427b72..8b03396fc 100644 --- a/docs/modules/ome_firmware_baseline_info.rst +++ b/docs/modules/ome_firmware_baseline_info.rst @@ -58,8 +58,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_firmware_catalog.rst b/docs/modules/ome_firmware_catalog.rst index fd2735fb0..99983a769 100644 --- a/docs/modules/ome_firmware_catalog.rst +++ b/docs/modules/ome_firmware_catalog.rst @@ -146,8 +146,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_groups.rst b/docs/modules/ome_groups.rst index a9b493844..d5abeab16 100644 --- a/docs/modules/ome_groups.rst +++ b/docs/modules/ome_groups.rst @@ -110,8 +110,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_identity_pool.rst b/docs/modules/ome_identity_pool.rst index ea0c1e24c..69c02acb2 100644 --- a/docs/modules/ome_identity_pool.rst +++ b/docs/modules/ome_identity_pool.rst @@ -170,8 +170,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_job_info.rst b/docs/modules/ome_job_info.rst index 8c45c85c1..cd4170162 100644 --- a/docs/modules/ome_job_info.rst +++ b/docs/modules/ome_job_info.rst @@ -75,8 +75,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_network_port_breakout.rst b/docs/modules/ome_network_port_breakout.rst index 0ee83f490..798f41bc2 100644 --- a/docs/modules/ome_network_port_breakout.rst +++ b/docs/modules/ome_network_port_breakout.rst @@ -66,8 +66,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_network_vlan.rst b/docs/modules/ome_network_vlan.rst index d84b557cc..e5dc4bdfa 100644 --- a/docs/modules/ome_network_vlan.rst +++ b/docs/modules/ome_network_vlan.rst @@ -94,8 +94,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_network_vlan_info.rst b/docs/modules/ome_network_vlan_info.rst index 4ce820ee8..266e67d90 100644 --- a/docs/modules/ome_network_vlan_info.rst +++ b/docs/modules/ome_network_vlan_info.rst @@ -66,8 +66,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_powerstate.rst b/docs/modules/ome_powerstate.rst index 866ef5eed..461f1ed57 100644 --- a/docs/modules/ome_powerstate.rst +++ b/docs/modules/ome_powerstate.rst @@ -70,8 +70,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_profile.rst b/docs/modules/ome_profile.rst index 21011d651..446cd530a 100644 --- a/docs/modules/ome_profile.rst +++ b/docs/modules/ome_profile.rst @@ -222,8 +222,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_smart_fabric.rst b/docs/modules/ome_smart_fabric.rst index cfe4c4333..1e6ddda5f 100644 --- a/docs/modules/ome_smart_fabric.rst +++ b/docs/modules/ome_smart_fabric.rst @@ -102,8 +102,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_smart_fabric_uplink.rst b/docs/modules/ome_smart_fabric_uplink.rst index 15df27419..83ddfcdca 100644 --- a/docs/modules/ome_smart_fabric_uplink.rst +++ b/docs/modules/ome_smart_fabric_uplink.rst @@ -118,8 +118,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_template.rst b/docs/modules/ome_template.rst index ec60b8b9d..d9062a56f 100644 --- a/docs/modules/ome_template.rst +++ b/docs/modules/ome_template.rst @@ -136,8 +136,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. @@ -490,9 +488,9 @@ Content (success, when I(command) is C(export), str, True Clear - + Ready -No +No Ready diff --git a/docs/modules/ome_template_identity_pool.rst b/docs/modules/ome_template_identity_pool.rst index 10de87cd6..ecff82b44 100644 --- a/docs/modules/ome_template_identity_pool.rst +++ b/docs/modules/ome_template_identity_pool.rst @@ -62,8 +62,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_template_info.rst b/docs/modules/ome_template_info.rst index faa5508c5..72e0b6d96 100644 --- a/docs/modules/ome_template_info.rst +++ b/docs/modules/ome_template_info.rst @@ -67,8 +67,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_template_network_vlan.rst b/docs/modules/ome_template_network_vlan.rst index 2f7fc93f7..6d2752fca 100644 --- a/docs/modules/ome_template_network_vlan.rst +++ b/docs/modules/ome_template_network_vlan.rst @@ -130,8 +130,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_user.rst b/docs/modules/ome_user.rst index 9f99bca26..4e46c91fc 100644 --- a/docs/modules/ome_user.rst +++ b/docs/modules/ome_user.rst @@ -84,8 +84,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/ome_user_info.rst b/docs/modules/ome_user_info.rst index 763e7e495..80e8250d1 100644 --- a/docs/modules/ome_user_info.rst +++ b/docs/modules/ome_user_info.rst @@ -67,8 +67,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/redfish_event_subscription.rst b/docs/modules/redfish_event_subscription.rst index c06ef8c7c..f7ab84455 100644 --- a/docs/modules/redfish_event_subscription.rst +++ b/docs/modules/redfish_event_subscription.rst @@ -78,8 +78,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/redfish_firmware.rst b/docs/modules/redfish_firmware.rst index 8e5fb65a8..d1225dd7f 100644 --- a/docs/modules/redfish_firmware.rst +++ b/docs/modules/redfish_firmware.rst @@ -63,8 +63,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/redfish_powerstate.rst b/docs/modules/redfish_powerstate.rst index 93236dfa3..fb05fe3e3 100644 --- a/docs/modules/redfish_powerstate.rst +++ b/docs/modules/redfish_powerstate.rst @@ -82,8 +82,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/docs/modules/redfish_storage_volume.rst b/docs/modules/redfish_storage_volume.rst index f4f00fd4d..72c0631d8 100644 --- a/docs/modules/redfish_storage_volume.rst +++ b/docs/modules/redfish_storage_volume.rst @@ -156,8 +156,6 @@ Parameters ca_path (optional, path, None) The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - *ca_path* is required if *validate_certs* is ``True`` - timeout (optional, int, 30) The socket level timeout in seconds. diff --git a/galaxy.yml b/galaxy.yml index 0a97ea6f4..7c48a42dc 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: dellemc name: openmanage -version: 5.0.0 +version: 5.0.1 readme: README.md authors: - Rajeev Arakkal diff --git a/plugins/doc_fragments/idrac_auth_options.py b/plugins/doc_fragments/idrac_auth_options.py index 4e0d970d1..5ca16d6d7 100644 --- a/plugins/doc_fragments/idrac_auth_options.py +++ b/plugins/doc_fragments/idrac_auth_options.py @@ -2,7 +2,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -45,7 +45,6 @@ class ModuleDocFragment(object): ca_path: description: - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - - I(ca_path) is required if I(validate_certs) is C(True) type: path version_added: 5.0.0 timeout: diff --git a/plugins/doc_fragments/ome_auth_options.py b/plugins/doc_fragments/ome_auth_options.py index cb330d701..b84c50d55 100644 --- a/plugins/doc_fragments/ome_auth_options.py +++ b/plugins/doc_fragments/ome_auth_options.py @@ -2,7 +2,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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,6 @@ class ModuleDocFragment(object): ca_path: description: - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - - I(ca_path) is required if I(validate_certs) is C(True) type: path version_added: 5.0.0 timeout: diff --git a/plugins/doc_fragments/omem_auth_options.py b/plugins/doc_fragments/omem_auth_options.py index d0212f1ed..d8c616b2a 100644 --- a/plugins/doc_fragments/omem_auth_options.py +++ b/plugins/doc_fragments/omem_auth_options.py @@ -2,7 +2,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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,6 @@ class ModuleDocFragment(object): ca_path: description: - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - - I(ca_path) is required if I(validate_certs) is C(True) type: path version_added: 5.0.0 timeout: diff --git a/plugins/doc_fragments/oment_auth_options.py b/plugins/doc_fragments/oment_auth_options.py index 31f1b013b..85b1553f7 100644 --- a/plugins/doc_fragments/oment_auth_options.py +++ b/plugins/doc_fragments/oment_auth_options.py @@ -2,7 +2,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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,6 @@ class ModuleDocFragment(object): ca_path: description: - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - - I(ca_path) is required if I(validate_certs) is C(True) type: path version_added: 5.0.0 timeout: diff --git a/plugins/doc_fragments/redfish_auth_options.py b/plugins/doc_fragments/redfish_auth_options.py index 37d03c1e4..8eb1eda15 100644 --- a/plugins/doc_fragments/redfish_auth_options.py +++ b/plugins/doc_fragments/redfish_auth_options.py @@ -2,7 +2,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -40,7 +40,6 @@ class ModuleDocFragment(object): ca_path: description: - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - - I(ca_path) is required if I(validate_certs) is C(True) type: path version_added: 5.0.0 timeout: diff --git a/plugins/module_utils/dellemc_idrac.py b/plugins/module_utils/dellemc_idrac.py index c3ea23820..fee5339c5 100644 --- a/plugins/module_utils/dellemc_idrac.py +++ b/plugins/module_utils/dellemc_idrac.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. # Redistribution and use in source and binary forms, with or without modification, @@ -28,7 +28,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type - +import os try: from omsdk.sdkinfra import sdkinfra from omsdk.sdkcreds import UserCredentials @@ -40,6 +40,17 @@ HAS_OMSDK = False +idrac_auth_params = { + "idrac_ip": {"required": True, "type": 'str'}, + "idrac_user": {"required": True, "type": 'str'}, + "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, + "idrac_port": {"required": False, "default": 443, "type": 'int'}, + "validate_certs": {"type": "bool", "default": True}, + "ca_path": {"type": "path"}, + "timeout": {"type": "int", "default": 30}, +} + + class iDRACConnection: def __init__(self, module_params): @@ -54,11 +65,16 @@ def __init__(self, module_params): self.handle = None self.creds = UserCredentials(self.idrac_user, self.idrac_pwd) self.validate_certs = module_params.get("validate_certs", False) + self.ca_path = module_params.get("ca_path") verify_ssl = False if self.validate_certs is True: - verify_ssl = module_params.get("ca_path") - self.pOp = WsManOptions(port=self.idrac_port, read_timeout=module_params.get("timeout", 30), - verify_ssl=verify_ssl) + if self.ca_path is None: + self.ca_path = self._get_omam_ca_env() + verify_ssl = self.ca_path + timeout = module_params.get("timeout", 30) + if not timeout or type(timeout) != int: + timeout = 30 + self.pOp = WsManOptions(port=self.idrac_port, read_timeout=timeout, verify_ssl=verify_ssl) self.sdk = sdkinfra() if self.sdk is None: msg = "Could not initialize iDRAC drivers." @@ -80,3 +96,9 @@ def __enter__(self): def __exit__(self, exc_type, exc_val, exc_tb): self.handle.disconnect() return False + + 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 True as ssl has to + be validated from omsdk with single param and is default to false in omsdk""" + return (os.environ.get("REQUESTS_CA_BUNDLE") or os.environ.get("CURL_CA_BUNDLE") + or os.environ.get("OMAM_CA_BUNDLE") or True) diff --git a/plugins/module_utils/idrac_redfish.py b/plugins/module_utils/idrac_redfish.py index 464cf9657..5ce08daf2 100644 --- a/plugins/module_utils/idrac_redfish.py +++ b/plugins/module_utils/idrac_redfish.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. # Redistribution and use in source and binary forms, with or without modification, @@ -32,10 +32,22 @@ import json import re import time +import os from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.six.moves.urllib.parse import urlencode +idrac_auth_params = { + "idrac_ip": {"required": True, "type": 'str'}, + "idrac_user": {"required": True, "type": 'str'}, + "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, + "idrac_port": {"required": False, "default": 443, "type": 'int'}, + "validate_certs": {"type": "bool", "default": True}, + "ca_path": {"type": "path"}, + "timeout": {"type": "int", "default": 30}, + +} + SESSION_RESOURCE_COLLECTION = { "SESSION": "/redfish/v1/Sessions", "SESSION_ID": "/redfish/v1/Sessions/{Id}", @@ -116,6 +128,8 @@ def _url_common_args_spec(self, method, api_timeout, headers=None): 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 = { "method": method, "validate_certs": self.validate_certs, @@ -325,3 +339,7 @@ def get_idrac_local_account_attr(self, idrac_attribues, fqdd=None): break user_attr = dict([(attr["Name"], attr["Value"]) for attr in attributes if attr["Name"].startswith("Users.")]) return user_attr + + 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") diff --git a/plugins/module_utils/ome.py b/plugins/module_utils/ome.py index 311a9fbe4..cdb5ddf2c 100644 --- a/plugins/module_utils/ome.py +++ b/plugins/module_utils/ome.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. # Redistribution and use in source and binary forms, with or without modification, @@ -31,11 +31,22 @@ __metaclass__ = type import json +import os import time from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.six.moves.urllib.parse import urlencode +ome_auth_params = { + "hostname": {"required": True, "type": "str"}, + "username": {"required": True, "type": "str"}, + "password": {"required": True, "type": "str", "no_log": True}, + "port": {"type": "int", "default": 443}, + "validate_certs": {"type": "bool", "default": True}, + "ca_path": {"type": "path"}, + "timeout": {"type": "int", "default": 30}, +} + SESSION_RESOURCE_COLLECTION = { "SESSION": "SessionService/Sessions", "SESSION_ID": "SessionService/Sessions('{Id}')", @@ -114,6 +125,8 @@ def _url_common_args_spec(self, method, api_timeout, headers=None): 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 = { "method": method, "validate_certs": self.validate_certs, @@ -380,3 +393,7 @@ def check_existing_job_state(self, job_type_name): job_allowed = True available_jobs = job_lst return job_allowed, available_jobs + + 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") diff --git a/plugins/module_utils/redfish.py b/plugins/module_utils/redfish.py index 03bddb787..59c467057 100644 --- a/plugins/module_utils/redfish.py +++ b/plugins/module_utils/redfish.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 Dell Inc. or its subsidiaries. All Rights Reserved. # Redistribution and use in source and binary forms, with or without modification, @@ -30,10 +30,20 @@ __metaclass__ = type import json +import os from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.six.moves.urllib.parse import urlencode +redfish_auth_params = { + "baseuri": {"required": True, "type": "str"}, + "username": {"required": True, "type": "str"}, + "password": {"required": True, "type": "str", "no_log": True}, + "validate_certs": {"type": "bool", "default": True}, + "ca_path": {"type": "path"}, + "timeout": {"type": "int", "default": 30}, +} + SESSION_RESOURCE_COLLECTION = { "SESSION": "/redfish/v1/Sessions", "SESSION_ID": "/redfish/v1/Sessions/{Id}", @@ -113,6 +123,8 @@ def _url_common_args_spec(self, method, api_timeout, headers=None): 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 = { "method": method, "validate_certs": self.validate_certs, @@ -201,3 +213,7 @@ def strip_substr_dict(self, odata_dict, chkstr='@odata.'): if chkstr in str(k).lower(): odata_dict.pop(k) return odata_dict + + 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") diff --git a/plugins/modules/dellemc_configure_idrac_eventing.py b/plugins/modules/dellemc_configure_idrac_eventing.py index b151a32be..401057fe8 100644 --- a/plugins/modules/dellemc_configure_idrac_eventing.py +++ b/plugins/modules/dellemc_configure_idrac_eventing.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -87,7 +87,7 @@ type: str description: Password for SMTP authentication. requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Felix Stephen (@felixs88)" notes: @@ -175,7 +175,7 @@ ''' import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -283,46 +283,33 @@ def run_idrac_eventing_config(idrac, module): def main(): + specs = dict( + share_name=dict(required=True, type='str'), + share_password=dict(required=False, type='str', aliases=['share_pwd'], no_log=True), + share_user=dict(required=False, type='str'), + share_mnt=dict(required=False, type='str'), + # setup SNMP Trap Destination + destination_number=dict(required=False, type="int"), + destination=dict(required=False, type="str"), + snmp_v3_username=dict(required=False, type="str"), + snmp_trap_state=dict(required=False, choices=["Enabled", "Disabled"], default=None), + # setup Email Alerts + alert_number=dict(required=False, type="int"), + address=dict(required=False, default=None, type="str"), + custom_message=dict(required=False, default=None, type="str"), + email_alert_state=dict(required=False, choices=["Enabled", "Disabled"], default=None), + # setup iDRAC Alerts + enable_alerts=dict(required=False, choices=["Enabled", "Disabled"], default=None), + # setup SMTP + authentication=dict(required=False, choices=['Enabled', 'Disabled'], default=None), + smtp_ip_address=dict(required=False, default=None, type='str'), + smtp_port=dict(required=False, type='str'), + username=dict(required=False, type="str"), + password=dict(required=False, type="str", no_log=True), + ) + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec=dict( - - # iDRAC credentials - idrac_ip=dict(required=True, type='str'), - idrac_user=dict(required=True, type='str'), - idrac_password=dict(required=True, type='str', aliases=['idrac_pwd'], no_log=True), - idrac_port=dict(required=False, default=443, type='int'), - validate_certs=dict(type='bool', default=True), - ca_path=dict(type='path'), - timeout=dict(type="int", default=30), - # Export Destination - share_name=dict(required=True, type='str'), - share_password=dict(required=False, type='str', aliases=['share_pwd'], no_log=True), - share_user=dict(required=False, type='str'), - share_mnt=dict(required=False, type='str'), - - # setup SNMP Trap Destination - destination_number=dict(required=False, type="int"), - destination=dict(required=False, type="str"), - snmp_v3_username=dict(required=False, type="str"), - snmp_trap_state=dict(required=False, choices=["Enabled", "Disabled"], default=None), - - # setup Email Alerts - alert_number=dict(required=False, type="int"), - address=dict(required=False, default=None, type="str"), - custom_message=dict(required=False, default=None, type="str"), - email_alert_state=dict(required=False, choices=["Enabled", "Disabled"], default=None), - - # setup iDRAC Alerts - enable_alerts=dict(required=False, choices=["Enabled", "Disabled"], default=None), - - # setup SMTP - authentication=dict(required=False, choices=['Enabled', 'Disabled'], default=None), - smtp_ip_address=dict(required=False, default=None, type='str'), - smtp_port=dict(required=False, type='str'), - username=dict(required=False, type="str"), - password=dict(required=False, type="str", no_log=True), - ), - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/dellemc_configure_idrac_services.py b/plugins/modules/dellemc_configure_idrac_services.py index 8faf4280a..6bbb658c4 100644 --- a/plugins/modules/dellemc_configure_idrac_services.py +++ b/plugins/modules/dellemc_configure_idrac_services.py @@ -50,7 +50,6 @@ ca_path: description: - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. - - I(ca_path) is required if I(validate_certs) is C(True) type: path version_added: 5.0.0 share_name: @@ -125,7 +124,7 @@ description: This option is used by iDRAC when it sends out SNMP and IPMI traps. The community name is checked by the remote system to which the traps are sent. requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Felix Stephen (@felixs88)" notes: @@ -361,7 +360,6 @@ def main(): trap_format=dict(required=False, choices=['SNMPv1', 'SNMPv2', 'SNMPv3'], default=None), ), - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True) try: diff --git a/plugins/modules/dellemc_get_firmware_inventory.py b/plugins/modules/dellemc_get_firmware_inventory.py index feb271f67..d667c916e 100644 --- a/plugins/modules/dellemc_get_firmware_inventory.py +++ b/plugins/modules/dellemc_get_firmware_inventory.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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 @@ - dellemc.openmanage.idrac_auth_options requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Rajeev Arakkal (@rajeevarakkal)" notes: @@ -86,7 +86,7 @@ import traceback -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.basic import AnsibleModule try: from omsdk.sdkfile import LocalFile @@ -130,18 +130,7 @@ def run_get_firmware_inventory(idrac, module): # Main def main(): module = AnsibleModule( - argument_spec=dict( - - # iDRAC Credentials - idrac_ip=dict(required=True, type='str'), - idrac_user=dict(required=True, type='str'), - idrac_password=dict(required=True, type='str', aliases=['idrac_pwd'], no_log=True), - idrac_port=dict(required=False, default=443, type='int'), - validate_certs=dict(type='bool', default=True), - ca_path=dict(type='path'), - timeout=dict(type="int", default=30) - ), - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=idrac_auth_params, supports_check_mode=True) try: diff --git a/plugins/modules/dellemc_get_system_inventory.py b/plugins/modules/dellemc_get_system_inventory.py index 91a7b1858..e6a2d9eaf 100644 --- a/plugins/modules/dellemc_get_system_inventory.py +++ b/plugins/modules/dellemc_get_system_inventory.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -29,7 +29,7 @@ - dellemc.openmanage.idrac_auth_options requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Rajeev Arakkal (@rajeevarakkal)" notes: @@ -98,7 +98,7 @@ """ -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.basic import AnsibleModule @@ -123,18 +123,7 @@ def run_get_system_inventory(idrac, module): # Main def main(): module = AnsibleModule( - argument_spec=dict( - - # iDRAC credentials - idrac_ip=dict(required=True, type='str'), - idrac_user=dict(required=True, type='str'), - idrac_password=dict(required=True, type='str', aliases=['idrac_pwd'], no_log=True), - idrac_port=dict(required=False, type='int', default=443), - validate_certs=dict(type='bool', default=True), - ca_path=dict(type='path'), - timeout=dict(type="int", default=30) - ), - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=idrac_auth_params, supports_check_mode=True) try: diff --git a/plugins/modules/dellemc_idrac_lc_attributes.py b/plugins/modules/dellemc_idrac_lc_attributes.py index 007e191da..6d91a02a8 100644 --- a/plugins/modules/dellemc_idrac_lc_attributes.py +++ b/plugins/modules/dellemc_idrac_lc_attributes.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -48,7 +48,7 @@ choices: [Enabled, Disabled] default: Enabled requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Felix Stephen (@felixs88)" notes: @@ -122,7 +122,7 @@ ''' import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -180,25 +180,16 @@ def run_setup_idrac_csior(idrac, module): # Main def main(): + specs = dict( + share_name=dict(required=True, type='str'), + share_password=dict(required=False, type='str', aliases=['share_pwd'], no_log=True), + share_user=dict(required=False, type='str'), + share_mnt=dict(required=False, type='str'), + csior=dict(required=False, choices=['Enabled', 'Disabled'], default='Enabled') + ) + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec=dict( - - # iDRAC credentials - idrac_ip=dict(required=True, type='str'), - idrac_user=dict(required=True, type='str'), - idrac_password=dict(required=True, type='str', aliases=['idrac_pwd'], no_log=True), - idrac_port=dict(required=False, default=443, type='int'), - validate_certs=dict(type='bool', default=True), - ca_path=dict(type='path'), - timeout=dict(type="int", default=30), - # Export Destination - share_name=dict(required=True, type='str'), - share_password=dict(required=False, type='str', aliases=['share_pwd'], no_log=True), - share_user=dict(required=False, type='str'), - share_mnt=dict(required=False, type='str'), - csior=dict(required=False, choices=['Enabled', 'Disabled'], default='Enabled') - ), - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/dellemc_idrac_storage_volume.py b/plugins/modules/dellemc_idrac_storage_volume.py index def8ef2d8..036ed3623 100644 --- a/plugins/modules/dellemc_idrac_storage_volume.py +++ b/plugins/modules/dellemc_idrac_storage_volume.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -122,7 +122,7 @@ choices: [None, Fast] requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Felix Stephen (@felixs88)" notes: @@ -251,7 +251,7 @@ import os import tempfile import copy -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.basic import AnsibleModule try: from omdrivers.types.iDRAC.RAID import RAIDactionTypes, RAIDdefaultReadPolicyTypes, RAIDinitOperationTypes, \ @@ -445,40 +445,33 @@ def run_server_raid_config(idrac, module): def main(): + specs = { + "state": {"required": False, "choices": ['create', 'delete', 'view'], "default": 'view'}, + "volume_id": {"required": False, "type": 'str'}, + "volumes": {"required": False, "type": 'list', "elements": 'dict'}, + "span_depth": {"required": False, "type": 'int', "default": 1}, + "span_length": {"required": False, "type": 'int', "default": 1}, + "number_dedicated_hot_spare": {"required": False, "type": 'int', "default": 0}, + "volume_type": {"required": False, + "choices": ['RAID 0', 'RAID 1', 'RAID 5', 'RAID 6', 'RAID 10', 'RAID 50', 'RAID 60'], + "default": 'RAID 0'}, + "disk_cache_policy": {"required": False, "choices": ["Default", "Enabled", "Disabled"], + "default": "Default"}, + "write_cache_policy": {"required": False, "choices": ["WriteThrough", "WriteBack", "WriteBackForce"], + "default": "WriteThrough"}, + "read_cache_policy": {"required": False, "choices": ["NoReadAhead", "ReadAhead", "AdaptiveReadAhead"], + "default": "NoReadAhead"}, + "stripe_size": {"required": False, "type": 'int', "default": 64 * 1024}, + "capacity": {"required": False, "type": 'float'}, + "controller_id": {"required": False, "type": 'str'}, + "media_type": {"required": False, "choices": ['HDD', 'SSD']}, + "protocol": {"required": False, "choices": ['SAS', 'SATA']}, + "raid_reset_config": {"required": False, "choices": ['True', 'False'], "default": 'False'}, + "raid_init_operation": {"required": False, "choices": ['None', 'Fast']} + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ["idrac_pwd"], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"required": False, - "choices": ['create', 'delete', 'view'], "default": 'view'}, - "volume_id": {"required": False, "type": 'str'}, - "volumes": {"required": False, "type": 'list', "elements": 'dict'}, - "span_depth": {"required": False, "type": 'int', "default": 1}, - "span_length": {"required": False, "type": 'int', "default": 1}, - "number_dedicated_hot_spare": {"required": False, "type": 'int', "default": 0}, - "volume_type": {"required": False, - "choices": ['RAID 0', 'RAID 1', 'RAID 5', 'RAID 6', 'RAID 10', 'RAID 50', 'RAID 60'], - "default": 'RAID 0'}, - "disk_cache_policy": {"required": False, "choices": ["Default", "Enabled", "Disabled"], - "default": "Default"}, - "write_cache_policy": {"required": False, "choices": ["WriteThrough", "WriteBack", "WriteBackForce"], - "default": "WriteThrough"}, - "read_cache_policy": {"required": False, "choices": ["NoReadAhead", "ReadAhead", "AdaptiveReadAhead"], - "default": "NoReadAhead"}, - "stripe_size": {"required": False, "type": 'int', "default": 64 * 1024}, - "capacity": {"required": False, "type": 'float'}, - "controller_id": {"required": False, "type": 'str'}, - "media_type": {"required": False, "choices": ['HDD', 'SSD']}, - "protocol": {"required": False, "choices": ['SAS', 'SATA']}, - "raid_reset_config": {"required": False, "choices": ['True', 'False'], "default": 'False'}, - "raid_init_operation": {"required": False, "choices": ['None', 'Fast']} - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/dellemc_system_lockdown_mode.py b/plugins/modules/dellemc_system_lockdown_mode.py index 923103948..f3a702f3e 100644 --- a/plugins/modules/dellemc_system_lockdown_mode.py +++ b/plugins/modules/dellemc_system_lockdown_mode.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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 @@ description: Whether to Enable or Disable system lockdown mode. choices: [Enabled, Disabled] requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Felix Stephen (@felixs88)" notes: @@ -126,7 +126,7 @@ ''' import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -180,28 +180,17 @@ def run_system_lockdown_mode(idrac, module): # Main def main(): + specs = dict( + share_name=dict(required=True, type='str'), + share_password=dict(required=False, type='str', + aliases=['share_pwd'], no_log=True), + share_user=dict(required=False, type='str'), + share_mnt=dict(required=False, type='str'), + lockdown_mode=dict(required=True, choices=['Enabled', 'Disabled']) + ) + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec=dict( - - # iDRAC credentials - idrac_ip=dict(required=True, type='str'), - idrac_user=dict(required=True, type='str'), - idrac_password=dict(required=True, type='str', - aliases=['idrac_pwd'], no_log=True), - idrac_port=dict(required=False, default=443, type='int'), - validate_certs=dict(type='bool', default=True), - ca_path=dict(type='path'), - timeout=dict(type="int", default=30), - # Share Details - share_name=dict(required=True, type='str'), - share_password=dict(required=False, type='str', - aliases=['share_pwd'], no_log=True), - share_user=dict(required=False, type='str'), - share_mnt=dict(required=False, type='str'), - - lockdown_mode=dict(required=True, choices=['Enabled', 'Disabled']) - ), - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=False) try: diff --git a/plugins/modules/idrac_bios.py b/plugins/modules/idrac_bios.py index 0ab9b61ba..0fabcfde4 100644 --- a/plugins/modules/idrac_bios.py +++ b/plugins/modules/idrac_bios.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -97,7 +97,7 @@ I(onetime_boot_mode), I(secure_boot_mode), I(nvme_mode), I(boot_mode). requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Felix Stephen (@felixs88)" @@ -240,7 +240,7 @@ import json 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.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.basic import AnsibleModule try: from omdrivers.enums.iDRAC.BIOS import (BootModeTypes, NvmeModeTypes, SecureBootModeTypes, @@ -380,32 +380,26 @@ def main(): mutual_exclusive_args = [['boot_sources', 'attributes'], ['boot_sources', 'secure_boot_mode'], ['boot_sources', 'boot_mode'], ['boot_sources', 'boot_sequence'], ['boot_sources', 'nvme_mode'], ['boot_sources', 'onetime_boot_mode']] + specs = { + "share_name": {"required": False, "type": 'str'}, + "share_user": {"required": False, "type": 'str'}, + "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, + "share_mnt": {"required": False, "type": 'str'}, + "boot_mode": {"required": False, "choices": ['Bios', 'Uefi']}, + "nvme_mode": {"required": False, "choices": ['NonRaid', 'Raid']}, + "secure_boot_mode": {"required": False, "choices": ['AuditMode', 'DeployedMode', 'SetupMode', 'UserMode']}, + "onetime_boot_mode": {"required": False, "choices": ['Disabled', 'OneTimeBootSeq', + 'OneTimeCustomBootSeqStr', 'OneTimeCustomHddSeqStr', + 'OneTimeCustomUefiBootSeqStr', 'OneTimeHddSeq', + 'OneTimeUefiBootSeq']}, + "boot_sequence": {"required": False, "type": "str"}, + "attributes": {"required": False, "type": 'dict'}, + "boot_sources": {"required": False, "type": 'list', 'elements': 'raw'} + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "share_name": {"required": False, "type": 'str'}, - "share_user": {"required": False, "type": 'str'}, - "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, - "share_mnt": {"required": False, "type": 'str'}, - "boot_mode": {"required": False, "choices": ['Bios', 'Uefi']}, - "nvme_mode": {"required": False, "choices": ['NonRaid', 'Raid']}, - "secure_boot_mode": {"required": False, "choices": ['AuditMode', 'DeployedMode', 'SetupMode', 'UserMode']}, - "onetime_boot_mode": {"required": False, "choices": ['Disabled', 'OneTimeBootSeq', - 'OneTimeCustomBootSeqStr', 'OneTimeCustomHddSeqStr', - 'OneTimeCustomUefiBootSeqStr', 'OneTimeHddSeq', - 'OneTimeUefiBootSeq']}, - "boot_sequence": {"required": False, "type": "str"}, - "attributes": {"required": False, "type": 'dict'}, - "boot_sources": {"required": False, "type": 'list', 'elements': 'raw'} - }, + argument_spec=specs, mutually_exclusive=mutual_exclusive_args, - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True ) try: diff --git a/plugins/modules/idrac_firmware.py b/plugins/modules/idrac_firmware.py index c88e53687..86cb9ad15 100644 --- a/plugins/modules/idrac_firmware.py +++ b/plugins/modules/idrac_firmware.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -74,7 +74,7 @@ default: False requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Rajeev Arakkal (@rajeevarakkal)" @@ -179,7 +179,7 @@ import time from ssl import SSLError from xml.etree import ElementTree as ET -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six.moves.urllib.parse import urlparse @@ -591,28 +591,21 @@ def update_firmware_redfish(idrac, module): def main(): + specs = { + "share_name": {"required": True, "type": 'str'}, + "share_user": {"required": False, "type": 'str'}, + "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, + "share_mnt": {"required": False, "type": 'str'}, + + "catalog_file_name": {"required": False, "type": 'str', "default": "Catalog.xml"}, + "reboot": {"required": False, "type": 'bool', "default": False}, + "job_wait": {"required": False, "type": 'bool', "default": True}, + "ignore_cert_warning": {"required": False, "type": 'bool', "default": True}, + "apply_update": {"required": False, "type": 'bool', "default": True}, + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - - "share_name": {"required": True, "type": 'str'}, - "share_user": {"required": False, "type": 'str'}, - "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, - "share_mnt": {"required": False, "type": 'str'}, - - "catalog_file_name": {"required": False, "type": 'str', "default": "Catalog.xml"}, - "reboot": {"required": False, "type": 'bool', "default": False}, - "job_wait": {"required": False, "type": 'bool', "default": True}, - "ignore_cert_warning": {"required": False, "type": 'bool', "default": True}, - "apply_update": {"required": False, "type": 'bool', "default": True}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) redfish_check = False diff --git a/plugins/modules/idrac_firmware_info.py b/plugins/modules/idrac_firmware_info.py index 011c986a0..3f644f85e 100644 --- a/plugins/modules/idrac_firmware_info.py +++ b/plugins/modules/idrac_firmware_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -23,7 +23,7 @@ - dellemc.openmanage.idrac_auth_options requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Rajeev Arakkal (@rajeevarakkal)" notes: @@ -105,7 +105,7 @@ import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -120,17 +120,10 @@ # Main def main(): + specs = {} + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/idrac_lifecycle_controller_job_status_info.py b/plugins/modules/idrac_lifecycle_controller_job_status_info.py index ad524c6f0..2d555f9a2 100644 --- a/plugins/modules/idrac_lifecycle_controller_job_status_info.py +++ b/plugins/modules/idrac_lifecycle_controller_job_status_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -27,7 +27,7 @@ type: str description: JOB ID in the format "JID_123456789012". requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Rajeev Arakkal (@rajeevarakkal)" @@ -96,25 +96,19 @@ import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError from ansible.module_utils.basic import AnsibleModule def main(): + specs = { + "job_id": {"required": True, "type": 'str'} + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "job_id": {"required": True, "type": 'str'} - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/idrac_lifecycle_controller_jobs.py b/plugins/modules/idrac_lifecycle_controller_jobs.py index 5da2c3793..984f8e3f4 100644 --- a/plugins/modules/idrac_lifecycle_controller_jobs.py +++ b/plugins/modules/idrac_lifecycle_controller_jobs.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -30,7 +30,7 @@ - All the jobs in the job queue are deleted if this option is not specified. requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Felix Stephen (@felixs88)" @@ -96,25 +96,18 @@ import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError def main(): + specs = { + "job_id": {"required": False, "type": 'str'} + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "job_id": {"required": False, "type": 'str'} - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=False) try: with iDRACConnection(module.params) as idrac: diff --git a/plugins/modules/idrac_lifecycle_controller_logs.py b/plugins/modules/idrac_lifecycle_controller_logs.py index 2c30fb4f2..74606260c 100644 --- a/plugins/modules/idrac_lifecycle_controller_logs.py +++ b/plugins/modules/idrac_lifecycle_controller_logs.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -43,7 +43,7 @@ default: True requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Rajeev Arakkal (@rajeevarakkal)" @@ -133,7 +133,7 @@ """ -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -189,22 +189,15 @@ def run_export_lc_logs(idrac, module): # Main() def main(): + specs = { + "share_name": {"required": True, "type": 'str'}, + "share_user": {"required": False, "type": 'str'}, + "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, + "job_wait": {"required": False, "type": 'bool', "default": True}, + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - - "share_name": {"required": True, "type": 'str'}, - "share_user": {"required": False, "type": 'str'}, - "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, - "job_wait": {"required": False, "type": 'bool', "default": True}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=False) try: diff --git a/plugins/modules/idrac_lifecycle_controller_status_info.py b/plugins/modules/idrac_lifecycle_controller_status_info.py index cc9e1b989..3d3bddc03 100644 --- a/plugins/modules/idrac_lifecycle_controller_status_info.py +++ b/plugins/modules/idrac_lifecycle_controller_status_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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 @@ - dellemc.openmanage.idrac_auth_options requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Rajeev Arakkal (@rajeevarakkal)" @@ -84,7 +84,7 @@ ''' -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError from ansible.module_utils.basic import AnsibleModule @@ -92,17 +92,10 @@ def main(): + specs = {} + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30} - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/idrac_network.py b/plugins/modules/idrac_network.py index 69e774aa3..54d400cd9 100644 --- a/plugins/modules/idrac_network.py +++ b/plugins/modules/idrac_network.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -108,7 +108,7 @@ type: str description: Enter the static IP subnet mask to iDRAC. requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Felix Stephen (@felixs88)" @@ -213,7 +213,7 @@ import json 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.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.basic import AnsibleModule try: from omdrivers.enums.iDRAC.iDRAC import (DNSRegister_NICTypes, DNSDomainFromDHCP_NICStaticTypes, @@ -347,59 +347,50 @@ def run_idrac_network_config(idrac, module): # Main def main(): - module = AnsibleModule( - argument_spec={ - - # iDRAC credentials - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - - # Export Destination - "share_name": {"required": True, "type": 'str'}, - "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, - "share_user": {"required": False, "type": 'str'}, - "share_mnt": {"required": False, "type": 'str'}, + specs = { + # Export Destination + "share_name": {"required": True, "type": 'str'}, + "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, + "share_user": {"required": False, "type": 'str'}, + "share_mnt": {"required": False, "type": 'str'}, - # setup DNS - "register_idrac_on_dns": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None}, - "dns_idrac_name": {"required": False, "default": None, "type": 'str'}, - "auto_config": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None, 'type': 'str'}, - "static_dns": {"required": False, "default": None, "type": "str"}, + # setup DNS + "register_idrac_on_dns": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None}, + "dns_idrac_name": {"required": False, "default": None, "type": 'str'}, + "auto_config": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None, 'type': 'str'}, + "static_dns": {"required": False, "default": None, "type": "str"}, - # set up idrac vlan - "setup_idrac_nic_vlan": {"required": False, "choices": ['Enabled', 'Disabled']}, - "vlan_id": {"required": False, "type": 'int'}, - "vlan_priority": {"required": False, "type": 'int'}, + # set up idrac vlan + "setup_idrac_nic_vlan": {"required": False, "choices": ['Enabled', 'Disabled']}, + "vlan_id": {"required": False, "type": 'int'}, + "vlan_priority": {"required": False, "type": 'int'}, - # set up NIC - "enable_nic": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None}, - "nic_selection": {"required": False, "choices": ['Dedicated', 'LOM1', 'LOM2', 'LOM3', 'LOM4'], "default": None}, - "failover_network": {"required": False, "choices": ['ALL', 'LOM1', 'LOM2', 'LOM3', 'LOM4', 'T_None'], - "default": None}, - "auto_detect": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None}, - "auto_negotiation": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None}, - "network_speed": {"required": False, "choices": ['T_10', 'T_100', 'T_1000'], "default": None}, - "duplex_mode": {"required": False, "choices": ['Full', 'Half'], "default": None}, - "nic_mtu": {"required": False, 'type': 'int'}, + # set up NIC + "enable_nic": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None}, + "nic_selection": {"required": False, "choices": ['Dedicated', 'LOM1', 'LOM2', 'LOM3', 'LOM4'], "default": None}, + "failover_network": {"required": False, "choices": ['ALL', 'LOM1', 'LOM2', 'LOM3', 'LOM4', 'T_None'], + "default": None}, + "auto_detect": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None}, + "auto_negotiation": {"required": False, "choices": ['Enabled', 'Disabled'], "default": None}, + "network_speed": {"required": False, "choices": ['T_10', 'T_100', 'T_1000'], "default": None}, + "duplex_mode": {"required": False, "choices": ['Full', 'Half'], "default": None}, + "nic_mtu": {"required": False, 'type': 'int'}, - # setup iDRAC IPV4 - "ip_address": {"required": False, "default": None, "type": "str"}, - "enable_dhcp": {"required": False, "choices": ["Enabled", "Disabled"], "default": None}, - "enable_ipv4": {"required": False, "choices": ["Enabled", "Disabled"], "default": None}, + # setup iDRAC IPV4 + "ip_address": {"required": False, "default": None, "type": "str"}, + "enable_dhcp": {"required": False, "choices": ["Enabled", "Disabled"], "default": None}, + "enable_ipv4": {"required": False, "choices": ["Enabled", "Disabled"], "default": None}, - # setup iDRAC Static IPv4 - "dns_from_dhcp": {"required": False, "choices": ["Enabled", "Disabled"], "default": None}, - "static_dns_1": {"required": False, "default": None, "type": "str"}, - "static_dns_2": {"required": False, "default": None, "type": "str"}, - "static_gateway": {"required": False, "type": "str"}, - "static_net_mask": {"required": False, "type": "str"}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + # setup iDRAC Static IPv4 + "dns_from_dhcp": {"required": False, "choices": ["Enabled", "Disabled"], "default": None}, + "static_dns_1": {"required": False, "default": None, "type": "str"}, + "static_dns_2": {"required": False, "default": None, "type": "str"}, + "static_gateway": {"required": False, "type": "str"}, + "static_net_mask": {"required": False, "type": "str"}, + } + specs.update(idrac_auth_params) + module = AnsibleModule( + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/idrac_os_deployment.py b/plugins/modules/idrac_os_deployment.py index a38ac2d86..797534e39 100644 --- a/plugins/modules/idrac_os_deployment.py +++ b/plugins/modules/idrac_os_deployment.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -43,7 +43,7 @@ type: int default: 1080 requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Felix Stephen (@felixs88)" @@ -93,7 +93,7 @@ import os -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible.module_utils.basic import AnsibleModule try: from omsdk.sdkfile import FileOnShare @@ -141,22 +141,16 @@ def run_boot_to_network_iso(idrac, module): def main(): + specs = { + "share_name": {"required": True, "type": 'str'}, + "share_user": {"required": False, "type": 'str'}, + "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, + "iso_image": {"required": True, "type": 'str'}, + "expose_duration": {"required": False, "type": 'int', "default": 1080} + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "share_name": {"required": True, "type": 'str'}, - "share_user": {"required": False, "type": 'str'}, - "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, - "iso_image": {"required": True, "type": 'str'}, - "expose_duration": {"required": False, "type": 'int', "default": 1080} - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=False) try: diff --git a/plugins/modules/idrac_redfish_storage_controller.py b/plugins/modules/idrac_redfish_storage_controller.py index 4148478b3..ab0c0f448 100644 --- a/plugins/modules/idrac_redfish_storage_controller.py +++ b/plugins/modules/idrac_redfish_storage_controller.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -220,7 +220,7 @@ import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish +from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params 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 @@ -315,27 +315,28 @@ def main(): 'RemoveControllerKey': ["controller_id"], 'ReKey': ["controller_id", "mode"] } + specs = { + "baseuri": {"required": True, "type": 'str'}, + "username": {"required": True, "type": 'str'}, + "password": {"required": True, "type": 'str', "no_log": True}, + "validate_certs": {"type": "bool", "default": True}, + "ca_path": {"type": "path"}, + "timeout": {"type": "int", "default": 30}, + "command": {"required": False, + "choices": ['ResetConfig', 'AssignSpare', 'SetControllerKey', 'RemoveControllerKey', 'ReKey'], + "default": 'AssignSpare'}, + "controller_id": {"required": False, "type": 'str'}, + "volume_id": {"required": False, "type": 'list', "elements": 'str'}, + "target": {"required": False, "type": 'str'}, + "key": {"required": False, "type": 'str', "no_log": True}, + "key_id": {"required": False, "type": 'str'}, + "old_key": {"required": False, "type": 'str', "no_log": True}, + "mode": {"required": False, "choices": ['LKM', 'SEKM'], "default": 'LKM'} + } + specs.update(redfish_auth_params) module = AnsibleModule( - argument_spec={ - "baseuri": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "command": {"required": False, - "choices": ['ResetConfig', 'AssignSpare', 'SetControllerKey', 'RemoveControllerKey', 'ReKey'], - "default": 'AssignSpare'}, - "controller_id": {"required": False, "type": 'str'}, - "volume_id": {"required": False, "type": 'list', "elements": 'str'}, - "target": {"required": False, "type": 'str'}, - "key": {"required": False, "type": 'str', "no_log": True}, - "key_id": {"required": False, "type": 'str'}, - "old_key": {"required": False, "type": 'str', "no_log": True}, - "mode": {"required": False, "choices": ['LKM', 'SEKM'], "default": 'LKM'} - }, + argument_spec=specs, required_if=[ - ['validate_certs', True, ['ca_path']], ["command", "SetControllerKey", req_map["SetControllerKey"]], ["command", "ReKey", req_map["ReKey"]], ["command", "ResetConfig", req_map["ResetConfig"]], diff --git a/plugins/modules/idrac_reset.py b/plugins/modules/idrac_reset.py index 4d2c8993a..8de5ffc9f 100644 --- a/plugins/modules/idrac_reset.py +++ b/plugins/modules/idrac_reset.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -26,7 +26,7 @@ - dellemc.openmanage.idrac_auth_options requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Felix Stephen (@felixs88)" @@ -93,7 +93,7 @@ import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -109,17 +109,10 @@ def run_idrac_reset(idrac, module): def main(): + specs = {} + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30} - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/idrac_server_config_profile.py b/plugins/modules/idrac_server_config_profile.py index 35477b3f1..42140eb96 100644 --- a/plugins/modules/idrac_server_config_profile.py +++ b/plugins/modules/idrac_server_config_profile.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -97,7 +97,7 @@ default: 'Default' requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Jagadeesh N V(@jagadeeshnv)" notes: @@ -305,7 +305,7 @@ import json from datetime import datetime from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -444,45 +444,37 @@ def run_export_import_scp_http(idrac, module): def main(): + specs = { + "command": {"required": False, "type": 'str', + "choices": ['export', 'import'], "default": 'export'}, + "job_wait": {"required": True, "type": 'bool'}, + + "share_name": {"required": True, "type": 'str'}, + "share_user": {"required": False, "type": 'str'}, + "share_password": {"required": False, "type": 'str', + "aliases": ['share_pwd'], "no_log": True}, + "scp_components": {"required": False, + "choices": ['ALL', 'IDRAC', 'BIOS', 'NIC', 'RAID'], + "default": 'ALL'}, + + "scp_file": {"required": False, "type": 'str'}, + "shutdown_type": {"required": False, + "choices": ['Graceful', 'Forced', 'NoReboot'], + "default": 'Graceful'}, + "end_host_power_state": {"required": False, + "choices": ['On', 'Off'], + "default": 'On'}, + + "export_format": {"required": False, "type": 'str', + "choices": ['JSON', 'XML'], "default": 'XML'}, + "export_use": {"required": False, "type": 'str', + "choices": ['Default', 'Clone', 'Replace'], "default": 'Default'} + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', - "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - - "command": {"required": False, "type": 'str', - "choices": ['export', 'import'], "default": 'export'}, - "job_wait": {"required": True, "type": 'bool'}, - - "share_name": {"required": True, "type": 'str'}, - "share_user": {"required": False, "type": 'str'}, - "share_password": {"required": False, "type": 'str', - "aliases": ['share_pwd'], "no_log": True}, - "scp_components": {"required": False, - "choices": ['ALL', 'IDRAC', 'BIOS', 'NIC', 'RAID'], - "default": 'ALL'}, - - "scp_file": {"required": False, "type": 'str'}, - "shutdown_type": {"required": False, - "choices": ['Graceful', 'Forced', 'NoReboot'], - "default": 'Graceful'}, - "end_host_power_state": {"required": False, - "choices": ['On', 'Off'], - "default": 'On'}, - - "export_format": {"required": False, "type": 'str', - "choices": ['JSON', 'XML'], "default": 'XML'}, - "export_use": {"required": False, "type": 'str', - "choices": ['Default', 'Clone', 'Replace'], "default": 'Default'} - }, + argument_spec=specs, required_if=[ ["command", "import", ["scp_file"]], - ['validate_certs', True, ['ca_path']], ], supports_check_mode=False) diff --git a/plugins/modules/idrac_syslog.py b/plugins/modules/idrac_syslog.py index 27641a5aa..d078b0851 100644 --- a/plugins/modules/idrac_syslog.py +++ b/plugins/modules/idrac_syslog.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -30,7 +30,7 @@ type: str default: Enabled requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Felix Stephen (@felixs88)" @@ -124,7 +124,7 @@ import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -163,22 +163,16 @@ def run_setup_idrac_syslog(idrac, module): def main(): + specs = { + "share_name": {"required": True, "type": 'str'}, + "share_user": {"required": False, "type": 'str'}, + "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, + "share_mnt": {"required": False, "type": 'str'}, + "syslog": {"required": False, "choices": ['Enabled', 'Disabled'], "default": 'Enabled'} + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "share_name": {"required": True, "type": 'str'}, - "share_user": {"required": False, "type": 'str'}, - "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, - "share_mnt": {"required": False, "type": 'str'}, - "syslog": {"required": False, "choices": ['Enabled', 'Disabled'], "default": 'Enabled'} - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/idrac_system_info.py b/plugins/modules/idrac_system_info.py index fa205459c..61827f2df 100644 --- a/plugins/modules/idrac_system_info.py +++ b/plugins/modules/idrac_system_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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 @@ - dellemc.openmanage.idrac_auth_options requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: "Rajeev Arakkal (@rajeevarakkal)" notes: @@ -88,7 +88,7 @@ ''' import json -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -96,17 +96,10 @@ # Main def main(): + specs = {} + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30} - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: with iDRACConnection(module.params) as idrac: diff --git a/plugins/modules/idrac_timezone_ntp.py b/plugins/modules/idrac_timezone_ntp.py index ac23b5483..165b412d1 100644 --- a/plugins/modules/idrac_timezone_ntp.py +++ b/plugins/modules/idrac_timezone_ntp.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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 @@ description: The IP address of the NTP server 3. requirements: - - "omsdk" + - "omsdk >= 1.2.488" - "python >= 3.8.6" author: - "Felix Stephen (@felixs88)" @@ -126,7 +126,7 @@ ''' -from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection +from ansible_collections.dellemc.openmanage.plugins.module_utils.dellemc_idrac import iDRACConnection, idrac_auth_params 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 @@ -188,35 +188,26 @@ def run_idrac_timezone_config(idrac, module): # Main def main(): + specs = { + # Export Destination + "share_name": {"required": True, "type": 'str'}, + "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, + "share_user": {"required": False, "type": 'str'}, + "share_mnt": {"required": False, "type": 'str'}, + + # setup NTP + "enable_ntp": {"required": False, "choices": ['Enabled', 'Disabled']}, + "ntp_server_1": {"required": False}, + "ntp_server_2": {"required": False}, + "ntp_server_3": {"required": False}, + + # set up timezone + "setup_idrac_timezone": {"required": False, "type": 'str'}, + + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - - # iDRAC credentials - "idrac_ip": {"required": True, "type": 'str'}, - "idrac_user": {"required": True, "type": 'str'}, - "idrac_password": {"required": True, "type": 'str', "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - - # Export Destination - "share_name": {"required": True, "type": 'str'}, - "share_password": {"required": False, "type": 'str', "aliases": ['share_pwd'], "no_log": True}, - "share_user": {"required": False, "type": 'str'}, - "share_mnt": {"required": False, "type": 'str'}, - - # setup NTP - "enable_ntp": {"required": False, "choices": ['Enabled', 'Disabled']}, - "ntp_server_1": {"required": False}, - "ntp_server_2": {"required": False}, - "ntp_server_3": {"required": False}, - - # set up timezone - "setup_idrac_timezone": {"required": False, "type": 'str'}, - - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: diff --git a/plugins/modules/idrac_user.py b/plugins/modules/idrac_user.py index 75e5fc868..df9f9adbe 100644 --- a/plugins/modules/idrac_user.py +++ b/plugins/modules/idrac_user.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2018-2022 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) @@ -205,7 +205,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.idrac_redfish import iDRACRedfishAPI, idrac_auth_params from ansible.module_utils.basic import AnsibleModule @@ -379,29 +379,23 @@ def remove_user_account(module, idrac, slot_uri, slot_id): def main(): + specs = { + "state": {"required": False, "choices": ['present', 'absent'], "default": "present"}, + "new_user_name": {"required": False}, + "user_name": {"required": True}, + "user_password": {"required": False, "no_log": True}, + "privilege": {"required": False, "choices": ['Administrator', 'ReadOnly', 'Operator', 'None']}, + "ipmi_lan_privilege": {"required": False, "choices": ['Administrator', 'Operator', 'User', 'No Access']}, + "ipmi_serial_privilege": {"required": False, "choices": ['Administrator', 'Operator', 'User', 'No Access']}, + "enable": {"required": False, "type": "bool"}, + "sol_enable": {"required": False, "type": "bool"}, + "protocol_enable": {"required": False, "type": "bool"}, + "authentication_protocol": {"required": False, "choices": ['SHA', 'MD5', 'None']}, + "privacy_protocol": {"required": False, "choices": ['AES', 'DES', 'None']}, + } + specs.update(idrac_auth_params) module = AnsibleModule( - argument_spec={ - "idrac_ip": {"required": True}, - "idrac_user": {"required": True}, - "idrac_password": {"required": True, "aliases": ['idrac_pwd'], "no_log": True}, - "idrac_port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"required": False, "choices": ['present', 'absent'], "default": "present"}, - "new_user_name": {"required": False}, - "user_name": {"required": True}, - "user_password": {"required": False, "no_log": True}, - "privilege": {"required": False, "choices": ['Administrator', 'ReadOnly', 'Operator', 'None']}, - "ipmi_lan_privilege": {"required": False, "choices": ['Administrator', 'Operator', 'User', 'No Access']}, - "ipmi_serial_privilege": {"required": False, "choices": ['Administrator', 'Operator', 'User', 'No Access']}, - "enable": {"required": False, "type": "bool"}, - "sol_enable": {"required": False, "type": "bool"}, - "protocol_enable": {"required": False, "type": "bool"}, - "authentication_protocol": {"required": False, "choices": ['SHA', 'MD5', 'None']}, - "privacy_protocol": {"required": False, "choices": ['AES', 'DES', 'None']}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True) try: with iDRACRedfishAPI(module.params, req_session=True) as idrac: diff --git a/plugins/modules/ome_active_directory.py b/plugins/modules/ome_active_directory.py index 85d6ebf8d..f68f45d4e 100644 --- a/plugins/modules/ome_active_directory.py +++ b/plugins/modules/ome_active_directory.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -239,17 +239,15 @@ } """ - 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.common.dict_transformations import recursive_diff - AD_URI = "AccountService/ExternalAccountProvider/ADAccountProvider" TEST_CONNECTION = "AccountService/ExternalAccountProvider/Actions/ExternalAccountProvider.TestADConnection" DELETE_AD = "AccountService/ExternalAccountProvider/Actions/ExternalAccountProvider.DeleteExternalAccountProvider" @@ -405,33 +403,27 @@ def delete_ad(module, rest_obj, ad): def main(): + specs = { + "state": {"type": 'str', "choices": ["present", "absent"], "default": 'present'}, + "name": {"type": 'str'}, + "id": {"type": 'int'}, + "domain_controller_lookup": {"type": 'str', "choices": ['MANUAL', 'DNS'], "default": 'DNS'}, + "domain_server": {"type": 'list', "elements": 'str'}, + "group_domain": {"type": 'str'}, + "domain_controller_port": {"type": 'int', "default": 3269}, + "network_timeout": {"type": 'int', "default": 120}, + "search_timeout": {"type": 'int', "default": 120}, + "validate_certificate": {"type": 'bool', "default": False}, + "certificate_file": {"type": 'path'}, + "test_connection": {"type": 'bool', "default": False}, + "domain_username": {"type": 'str'}, + "domain_password": {"type": 'str', "no_log": True} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"type": 'str', "choices": ["present", "absent"], "default": 'present'}, - "name": {"type": 'str'}, - "id": {"type": 'int'}, - "domain_controller_lookup": {"type": 'str', "choices": ['MANUAL', 'DNS'], "default": 'DNS'}, - "domain_server": {"type": 'list', "elements": 'str'}, - "group_domain": {"type": 'str'}, - "domain_controller_port": {"type": 'int', "default": 3269}, - "network_timeout": {"type": 'int', "default": 120}, - "search_timeout": {"type": 'int', "default": 120}, - "validate_certificate": {"type": 'bool', "default": False}, - "certificate_file": {"type": 'path'}, - "test_connection": {"type": 'bool', "default": False}, - "domain_username": {"type": 'str'}, - "domain_password": {"type": 'str', "no_log": True} - }, + argument_spec=specs, required_one_of=[('name', 'id')], required_if=[ - ['validate_certs', True, ['ca_path']], ('test_connection', True, ('domain_username', 'domain_password',)), ('validate_certificate', True, ('certificate_file',))], mutually_exclusive=[('name', 'id')], @@ -456,7 +448,9 @@ def main(): module.fail_json(msg=str(err), error_info=json.load(err)) except URLError as err: module.exit_json(msg=str(err), unreachable=True) - except (IOError, ValueError, SSLError, TypeError, ConnectionError, AttributeError, IndexError, KeyError, OSError) as err: + except ( + IOError, ValueError, SSLError, TypeError, ConnectionError, AttributeError, IndexError, KeyError, + OSError) as err: module.fail_json(msg=str(err)) diff --git a/plugins/modules/ome_application_alerts_smtp.py b/plugins/modules/ome_application_alerts_smtp.py index 4e6482fd7..66a8b26c0 100644 --- a/plugins/modules/ome_application_alerts_smtp.py +++ b/plugins/modules/ome_application_alerts_smtp.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -142,7 +142,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.common.dict_transformations import recursive_diff SUCCESS_MSG = "Successfully updated the SMTP settings." @@ -225,26 +225,20 @@ def main(): credentials_options = {"username": {"type": "str", "required": True}, "password": {"type": "str", "required": True, "no_log": True}} + specs = { + "destination_address": {"required": True, "type": "str"}, + "port_number": {"required": False, "type": "int"}, + "use_ssl": {"required": False, "type": "bool"}, + "enable_authentication": {"required": True, "type": "bool"}, + "credentials": + {"required": False, "type": "dict", + "options": credentials_options, + }, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "destination_address": {"required": True, "type": "str"}, - "port_number": {"required": False, "type": "int"}, - "use_ssl": {"required": False, "type": "bool"}, - "enable_authentication": {"required": True, "type": "bool"}, - "credentials": - {"required": False, "type": "dict", - "options": credentials_options, - }, - }, - required_if=[['enable_authentication', True, ['credentials']], - ['validate_certs', True, ['ca_path']]], + argument_spec=specs, + required_if=[['enable_authentication', True, ['credentials']], ], supports_check_mode=True ) try: @@ -261,7 +255,9 @@ def main(): fail_module(module, msg=str(err), error_info=json.load(err)) except URLError as err: exit_module(module, msg=str(err), unreachable=True) - except (IOError, ValueError, SSLError, TypeError, ConnectionError, AttributeError, IndexError, KeyError, OSError) as err: + except ( + IOError, ValueError, SSLError, TypeError, ConnectionError, AttributeError, IndexError, KeyError, + OSError) as err: fail_module(module, msg=str(err), error_info=json.load(err)) diff --git a/plugins/modules/ome_application_alerts_syslog.py b/plugins/modules/ome_application_alerts_syslog.py index 1334f91f5..12c212450 100644 --- a/plugins/modules/ome_application_alerts_syslog.py +++ b/plugins/modules/ome_application_alerts_syslog.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -155,7 +155,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.common.dict_transformations import recursive_diff from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict @@ -220,27 +220,22 @@ def compare_get_payload(module, current_list, input_config): def main(): + specs = { + "syslog_servers": + {"type": 'list', "elements": 'dict', "options": + {"id": {"type": 'int', "choices": [1, 2, 3, 4], "required": True}, + "enabled": {"type": 'bool'}, + "destination_address": {"type": 'str'}, + "port_number": {"type": 'int'} + }, + "required_one_of": [("enabled", "destination_address", "port_number")], + "required_if": [("enabled", True, ("destination_address",))] + } + } + specs.update(ome_auth_params) + module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "syslog_servers": - {"type": 'list', "elements": 'dict', "options": - {"id": {"type": 'int', "choices": [1, 2, 3, 4], "required": True}, - "enabled": {"type": 'bool'}, - "destination_address": {"type": 'str'}, - "port_number": {"type": 'int'} - }, - "required_one_of": [("enabled", "destination_address", "port_number")], - "required_if": [("enabled", True, ("destination_address",))] - } - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True ) try: @@ -255,7 +250,9 @@ def main(): module.fail_json(msg=str(err), error_info=json.load(err)) except URLError as err: module.exit_json(msg=str(err), unreachable=True) - except (IOError, ValueError, SSLError, TypeError, ConnectionError, AttributeError, IndexError, KeyError, OSError) as err: + except ( + IOError, ValueError, SSLError, TypeError, ConnectionError, AttributeError, IndexError, KeyError, + OSError) as err: module.fail_json(msg=str(err)) diff --git a/plugins/modules/ome_application_certificate.py b/plugins/modules/ome_application_certificate.py index f3b58ef38..3c9b26994 100644 --- a/plugins/modules/ome_application_certificate.py +++ b/plugins/modules/ome_application_certificate.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -11,6 +11,7 @@ from __future__ import (absolute_import, division, print_function) + __metaclass__ = type DOCUMENTATION = r''' @@ -135,7 +136,7 @@ import os from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -163,28 +164,22 @@ def get_resource_parameters(module): def main(): + specs = { + "command": {"type": "str", "required": False, + "choices": ["generate_csr", "upload"], "default": "generate_csr"}, + "distinguished_name": {"required": False, "type": "str"}, + "department_name": {"required": False, "type": "str"}, + "business_name": {"required": False, "type": "str"}, + "locality": {"required": False, "type": "str"}, + "country_state": {"required": False, "type": "str"}, + "country": {"required": False, "type": "str"}, + "email": {"required": False, "type": "str"}, + "upload_file": {"required": False, "type": "str"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "command": {"type": "str", "required": False, - "choices": ["generate_csr", "upload"], "default": "generate_csr"}, - "distinguished_name": {"required": False, "type": "str"}, - "department_name": {"required": False, "type": "str"}, - "business_name": {"required": False, "type": "str"}, - "locality": {"required": False, "type": "str"}, - "country_state": {"required": False, "type": "str"}, - "country": {"required": False, "type": "str"}, - "email": {"required": False, "type": "str"}, - "upload_file": {"required": False, "type": "str"}, - }, - required_if=[['validate_certs', True, ['ca_path']], - ["command", "generate_csr", ["distinguished_name", "department_name", + argument_spec=specs, + required_if=[["command", "generate_csr", ["distinguished_name", "department_name", "business_name", "locality", "country_state", "country", "email"]], ["command", "upload", ["upload_file"]]], diff --git a/plugins/modules/ome_application_network_address.py b/plugins/modules/ome_application_network_address.py index a0d0ca29e..1be43e9e1 100644 --- a/plugins/modules/ome_application_network_address.py +++ b/plugins/modules/ome_application_network_address.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -423,12 +423,11 @@ } ''' - 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -676,52 +675,48 @@ def main(): "dns_domain_name": {"required": False, "type": "str"}} management_vlan = {"enable_vlan": {"required": True, "type": "bool"}, "vlan_id": {"required": False, "type": "int"}} + + specs = { + "enable_nic": {"required": False, "type": "bool", "default": True}, + "interface_name": {"required": False, "type": "str"}, + "ipv4_configuration": + {"required": False, "type": "dict", "options": ipv4_options, + "required_if": [ + ['enable', True, ('enable_dhcp',), True], + ['enable_dhcp', False, ('static_ip_address', 'static_subnet_mask', "static_gateway"), False], + ['use_dhcp_for_dns_server_names', False, + ('static_preferred_dns_server', 'static_alternate_dns_server'), True] + ] + }, + "ipv6_configuration": + {"required": False, "type": "dict", "options": ipv6_options, + "required_if": [ + ['enable', True, ('enable_auto_configuration',), True], + ['enable_auto_configuration', False, ('static_ip_address', 'static_prefix_length', "static_gateway"), + False], + ['use_dhcp_for_dns_server_names', False, + ('static_preferred_dns_server', 'static_alternate_dns_server'), True] + ] + }, + "dns_configuration": + {"required": False, "type": "dict", "options": dns_options, + "required_if": [ + ['register_with_dns', True, ('dns_name',), False], + ['use_dhcp_for_dns_domain_name', False, ('dns_domain_name',)] + ] + }, + "management_vlan": + {"required": False, "type": "dict", "options": management_vlan, + "required_if": [ + ['enable_vlan', True, ('vlan_id',), True] + ] + }, + "reboot_delay": {"required": False, "type": "int"} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "enable_nic": {"required": False, "type": "bool", "default": True}, - "interface_name": {"required": False, "type": "str"}, - "ipv4_configuration": - {"required": False, "type": "dict", "options": ipv4_options, - "required_if": [ - ['enable', True, ('enable_dhcp',), True], - ['enable_dhcp', False, ('static_ip_address', 'static_subnet_mask', "static_gateway"), False], - ['use_dhcp_for_dns_server_names', False, - ('static_preferred_dns_server', 'static_alternate_dns_server'), True] - ] - }, - "ipv6_configuration": - {"required": False, "type": "dict", "options": ipv6_options, - "required_if": [ - ['enable', True, ('enable_auto_configuration',), True], - ['enable_auto_configuration', False, ('static_ip_address', 'static_prefix_length', "static_gateway"), False], - ['use_dhcp_for_dns_server_names', False, - ('static_preferred_dns_server', 'static_alternate_dns_server'), True] - ] - }, - "dns_configuration": - {"required": False, "type": "dict", "options": dns_options, - "required_if": [ - ['register_with_dns', True, ('dns_name',), False], - ['use_dhcp_for_dns_domain_name', False, ('dns_domain_name',)] - ] - }, - "management_vlan": - {"required": False, "type": "dict", "options": management_vlan, - "required_if": [ - ['enable_vlan', True, ('vlan_id',), True] - ] - }, - "reboot_delay": {"required": False, "type": "int"} - }, + argument_spec=specs, required_if=[ - ['validate_certs', True, ['ca_path']], ["enable_nic", True, ("ipv4_configuration", "ipv6_configuration", "dns_configuration", "management_vlan"), True] ], diff --git a/plugins/modules/ome_application_network_proxy.py b/plugins/modules/ome_application_network_proxy.py index e32e285a6..3659d8a3d 100644 --- a/plugins/modules/ome_application_network_proxy.py +++ b/plugins/modules/ome_application_network_proxy.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -11,6 +11,7 @@ from __future__ import (absolute_import, division, print_function) + __metaclass__ = type DOCUMENTATION = r''' @@ -145,7 +146,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -183,7 +184,7 @@ def get_payload(module): "enable_authentication": "EnableAuthentication" } backup_params = params.copy() - remove_keys = ["hostname", "username", "password", "port", "ca_path"] + remove_keys = ["hostname", "username", "password", "port", "ca_path", "validate_certs", "timeout"] remove_unwanted_keys(remove_keys, backup_params) payload = dict([(proxy_payload_map[key], val) for key, val in backup_params.items() if val is not None]) return payload @@ -216,24 +217,18 @@ def get_updated_payload(rest_obj, module, payload): def main(): + specs = { + "ip_address": {"required": False, "type": "str"}, + "proxy_port": {"required": False, "type": "int"}, + "enable_proxy": {"required": True, "type": "bool"}, + "proxy_username": {"required": False, "type": "str"}, + "proxy_password": {"required": False, "type": "str", "no_log": True}, + "enable_authentication": {"required": False, "type": "bool"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "ip_address": {"required": False, "type": "str"}, - "proxy_port": {"required": False, "type": "int"}, - "enable_proxy": {"required": True, "type": "bool"}, - "proxy_username": {"required": False, "type": "str"}, - "proxy_password": {"required": False, "type": "str", "no_log": True}, - "enable_authentication": {"required": False, "type": "bool"}, - }, - required_if=[['validate_certs', True, ['ca_path']], - ['enable_proxy', True, ['ip_address', 'proxy_port']], + argument_spec=specs, + required_if=[['enable_proxy', True, ['ip_address', 'proxy_port']], ['enable_authentication', True, ['proxy_username', 'proxy_password']], ], supports_check_mode=True ) @@ -242,8 +237,9 @@ def main(): payload = get_payload(module) updated_payload = get_updated_payload(rest_obj, module, payload) resp = rest_obj.invoke_request("PUT", PROXY_CONFIG, data=updated_payload) - module.exit_json(msg="Successfully updated network proxy configuration.", proxy_configuration=resp.json_data, - changed=True) + module.exit_json(msg="Successfully updated network proxy configuration.", + proxy_configuration=resp.json_data, + changed=True) except HTTPError as err: module.fail_json(msg=str(err), error_info=json.load(err)) except URLError as err: diff --git a/plugins/modules/ome_application_network_settings.py b/plugins/modules/ome_application_network_settings.py index 6adbab453..2dfd13a58 100644 --- a/plugins/modules/ome_application_network_settings.py +++ b/plugins/modules/ome_application_network_settings.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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,7 +253,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params SUCCESS_MSG = "Successfully updated the session timeout settings." SESSION_INACTIVITY_GET = "SessionService/SessionConfiguration" @@ -339,32 +339,26 @@ def main(): "serial_timeout": {"type": "float", "required": False}, "serial_sessions": {"type": "int", "required": False}, } + specs = { + "session_inactivity_timeout": { + "required": False, + "type": "dict", + "options": session_inactivity_options, + "mutually_exclusive": [ + ['universal_timeout', 'api_timeout'], + ['universal_timeout', 'gui_timeout'], + ['universal_timeout', 'ssh_timeout'], + ['universal_timeout', 'serial_timeout'] + ], + "required_if": [ + ['enable_universal_timeout', True, ['universal_timeout']] + ] + } + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "session_inactivity_timeout": { - "required": False, - "type": "dict", - "options": session_inactivity_options, - "mutually_exclusive": [ - ['universal_timeout', 'api_timeout'], - ['universal_timeout', 'gui_timeout'], - ['universal_timeout', 'ssh_timeout'], - ['universal_timeout', 'serial_timeout'] - ], - "required_if": [ - ['enable_universal_timeout', True, ['universal_timeout']] - ] - } - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True ) try: @@ -380,7 +374,9 @@ def main(): module.fail_json(msg=str(err), error_info=json.load(err)) except URLError as err: module.exit_json(msg=str(err), unreachable=True) - except (IOError, ValueError, SSLError, TypeError, ConnectionError, AttributeError, IndexError, KeyError, OSError) as err: + except ( + IOError, ValueError, SSLError, TypeError, ConnectionError, AttributeError, IndexError, KeyError, + OSError) as err: module.fail_json(msg=str(err), error_info=json.load(err)) diff --git a/plugins/modules/ome_application_network_time.py b/plugins/modules/ome_application_network_time.py index f6baf399a..381ef3191 100644 --- a/plugins/modules/ome_application_network_time.py +++ b/plugins/modules/ome_application_network_time.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -140,7 +140,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -163,7 +163,7 @@ def get_payload(module): "secondary_ntp_address2": "SecondaryNTPAddress2" } backup_params = params.copy() - remove_keys = ["hostname", "username", "password", "port", "ca_path"] + remove_keys = ["hostname", "username", "password", "port", "ca_path", "validate_certs", "timeout"] remove_unwanted_keys(remove_keys, backup_params) payload = dict([(proxy_payload_map[key], val) for key, val in backup_params.items() if val is not None]) return payload @@ -222,24 +222,18 @@ def validate_input(module): def main(): + specs = { + "enable_ntp": {"required": True, "type": "bool"}, + "time_zone": {"required": False, "type": "str"}, + "system_time": {"required": False, "type": "str"}, + "primary_ntp_address": {"required": False, "type": "str"}, + "secondary_ntp_address1": {"required": False, "type": "str"}, + "secondary_ntp_address2": {"required": False, "type": "str"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "enable_ntp": {"required": True, "type": "bool"}, - "time_zone": {"required": False, "type": "str"}, - "system_time": {"required": False, "type": "str"}, - "primary_ntp_address": {"required": False, "type": "str"}, - "secondary_ntp_address1": {"required": False, "type": "str"}, - "secondary_ntp_address2": {"required": False, "type": "str"}, - }, - required_if=[['validate_certs', True, ['ca_path']], - ['enable_ntp', False, ('time_zone', 'system_time',), True], + argument_spec=specs, + required_if=[['enable_ntp', False, ('time_zone', 'system_time',), True], ['enable_ntp', True, ('time_zone', 'primary_ntp_address', 'secondary_ntp_address1', 'secondary_ntp_address2'), True]], mutually_exclusive=[['system_time', 'primary_ntp_address'], diff --git a/plugins/modules/ome_application_network_webserver.py b/plugins/modules/ome_application_network_webserver.py index 3da0cc781..b97247553 100644 --- a/plugins/modules/ome_application_network_webserver.py +++ b/plugins/modules/ome_application_network_webserver.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -11,6 +11,7 @@ from __future__ import (absolute_import, division, print_function) + __metaclass__ = type DOCUMENTATION = r''' @@ -114,7 +115,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -157,20 +158,14 @@ def get_updated_payload(rest_obj, module): def main(): + specs = { + "webserver_port": {"required": False, "type": "int"}, + "webserver_timeout": {"required": False, "type": "int"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "webserver_port": {"required": False, "type": "int"}, - "webserver_timeout": {"required": False, "type": "int"}, - }, + argument_spec=specs, required_one_of=[["webserver_port", "webserver_timeout"]], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True ) try: diff --git a/plugins/modules/ome_application_security_settings.py b/plugins/modules/ome_application_security_settings.py index c70d47e6b..d2b23c256 100644 --- a/plugins/modules/ome_application_security_settings.py +++ b/plugins/modules/ome_application_security_settings.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -203,7 +203,7 @@ import time from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -310,41 +310,36 @@ def login_security_setting(module, rest_obj): def main(): - module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "restrict_allowed_ip_range": { - "type": 'dict', "options": { - "enable_ip_range": {"type": 'bool', "required": True}, - "ip_range": {"type": 'str'} - }, - "required_if": [("enable_ip_range", True, ("ip_range",))] + specs = { + "restrict_allowed_ip_range": { + "type": 'dict', "options": { + "enable_ip_range": {"type": 'bool', "required": True}, + "ip_range": {"type": 'str'} }, - "login_lockout_policy": { - "type": 'dict', "options": { - "by_user_name": {"type": 'bool'}, - "by_ip_address": {"type": 'bool'}, - "lockout_fail_count": {"type": 'int'}, - "lockout_fail_window": {"type": 'int'}, - "lockout_penalty_time": {"type": 'int'} - }, - "required_one_of": [("by_user_name", "by_ip_address", "lockout_fail_count", - "lockout_fail_window", "lockout_penalty_time")] + "required_if": [("enable_ip_range", True, ("ip_range",))] + }, + "login_lockout_policy": { + "type": 'dict', "options": { + "by_user_name": {"type": 'bool'}, + "by_ip_address": {"type": 'bool'}, + "lockout_fail_count": {"type": 'int'}, + "lockout_fail_window": {"type": 'int'}, + "lockout_penalty_time": {"type": 'int'} }, - "fips_mode_enable": {"type": 'bool'}, - "job_wait": {"type": 'bool', "default": True}, - "job_wait_timeout": {"type": 'int', "default": 120} + "required_one_of": [("by_user_name", "by_ip_address", "lockout_fail_count", + "lockout_fail_window", "lockout_penalty_time")] }, + "fips_mode_enable": {"type": 'bool'}, + "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=[("fips_mode_enable", "login_lockout_policy"), ("fips_mode_enable", "restrict_allowed_ip_range")], required_one_of=[("restrict_allowed_ip_range", "login_lockout_policy", "fips_mode_enable")], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True) try: diff --git a/plugins/modules/ome_chassis_slots.py b/plugins/modules/ome_chassis_slots.py index 4e97325ee..6b89fea16 100644 --- a/plugins/modules/ome_chassis_slots.py +++ b/plugins/modules/ome_chassis_slots.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -257,7 +257,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.common.dict_transformations import recursive_diff DEVICE_URI = "DeviceService/Devices" @@ -556,39 +556,33 @@ def slot_number_config(module, rest_obj): def main(): + specs = { + "device_options": {"type": 'list', "elements": 'dict', + "options": { + "slot_name": {"required": True, 'type': 'str'}, + "device_id": {"type": 'int'}, + "device_service_tag": {"type": 'str'} + }, + "mutually_exclusive": [('device_id', 'device_service_tag')], + "required_one_of": [('device_id', 'device_service_tag')] + }, + "slot_options": {"type": 'list', "elements": 'dict', + "options": { + "chassis_service_tag": {"required": True, 'type': 'str'}, + "slots": {"required": True, "type": 'list', "elements": 'dict', + "options": { + "slot_number": {"required": True, 'type': 'int'}, + "slot_name": {"required": True, "type": 'str'} + }, + }, + }, + }, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "device_options": {"type": 'list', "elements": 'dict', - "options": { - "slot_name": {"required": True, 'type': 'str'}, - "device_id": {"type": 'int'}, - "device_service_tag": {"type": 'str'} - }, - "mutually_exclusive": [('device_id', 'device_service_tag')], - "required_one_of": [('device_id', 'device_service_tag')] - }, - "slot_options": {"type": 'list', "elements": 'dict', - "options": { - "chassis_service_tag": {"required": True, 'type': 'str'}, - "slots": {"required": True, "type": 'list', "elements": 'dict', - "options": { - "slot_number": {"required": True, 'type': 'int'}, - "slot_name": {"required": True, "type": 'str'} - }, - }, - }, - }, - }, + argument_spec=specs, required_one_of=[('slot_options', 'device_options')], mutually_exclusive=[('slot_options', 'device_options')], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True ) diff --git a/plugins/modules/ome_configuration_compliance_baseline.py b/plugins/modules/ome_configuration_compliance_baseline.py index 036a8452c..5cac7352d 100644 --- a/plugins/modules/ome_configuration_compliance_baseline.py +++ b/plugins/modules/ome_configuration_compliance_baseline.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -291,7 +291,7 @@ import re from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -796,30 +796,24 @@ def compliance_operation(module, rest_obj): def main(): + specs = { + "command": {"default": "create", + "choices": ['create', 'modify', 'delete', 'remediate']}, + "names": {"required": True, "type": 'list', "elements": 'str'}, + "template_name": {"type": 'str'}, + "template_id": {"type": 'int'}, + "device_ids": {"required": False, "type": 'list', "elements": 'int'}, + "device_service_tags": {"required": False, "type": 'list', "elements": 'str'}, + "device_group_names": {"required": False, "type": 'list', "elements": 'str'}, + "description": {"type": 'str'}, + "job_wait": {"required": False, "type": 'bool', "default": True}, + "job_wait_timeout": {"required": False, "type": 'int', "default": 10800}, + "new_name": {"type": 'str'}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "command": {"default": "create", - "choices": ['create', 'modify', 'delete', 'remediate']}, - "names": {"required": True, "type": 'list', "elements": 'str'}, - "template_name": {"type": 'str'}, - "template_id": {"type": 'int'}, - "device_ids": {"required": False, "type": 'list', "elements": 'int'}, - "device_service_tags": {"required": False, "type": 'list', "elements": 'str'}, - "device_group_names": {"required": False, "type": 'list', "elements": 'str'}, - "description": {"type": 'str'}, - "job_wait": {"required": False, "type": 'bool', "default": True}, - "job_wait_timeout": {"required": False, "type": 'int', "default": 10800}, - "new_name": {"type": 'str'}, - }, + argument_spec=specs, required_if=[ - ['validate_certs', True, ['ca_path']], ['command', 'create', ['template_name', 'template_id'], True], ['command', 'remediate', ['device_ids', 'device_service_tags', 'job_wait', 'job_wait_timeout'], True], ['command', 'modify', diff --git a/plugins/modules/ome_configuration_compliance_info.py b/plugins/modules/ome_configuration_compliance_info.py index 36e237d9a..0846f142c 100644 --- a/plugins/modules/ome_configuration_compliance_info.py +++ b/plugins/modules/ome_configuration_compliance_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -147,7 +147,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -212,21 +212,15 @@ def compliance_report(module, rest_obj): def main(): + specs = { + "baseline": {"required": True, "type": "str"}, + "device_id": {"required": False, "type": "int"}, + "device_service_tag": {"required": False, "type": "str"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "default": 443, "type": "int"}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "baseline": {"required": True, "type": "str"}, - "device_id": {"required": False, "type": "int"}, - "device_service_tag": {"required": False, "type": "str"}, - }, + argument_spec=specs, mutually_exclusive=[["device_id", "device_service_tag"]], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True ) try: diff --git a/plugins/modules/ome_device_group.py b/plugins/modules/ome_device_group.py index 997a7e89e..09a7f38b6 100644 --- a/plugins/modules/ome_device_group.py +++ b/plugins/modules/ome_device_group.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -197,7 +197,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -366,24 +366,18 @@ def add_member_to_group(module, rest_obj, group_id, device_id, key): def main(): + specs = { + "name": {"type": "str"}, + "group_id": {"type": "int"}, + "state": {"required": False, "type": "str", "choices": ["present", "absent"], "default": "present"}, + "device_service_tags": {"required": False, "type": "list", "elements": 'str'}, + "device_ids": {"required": False, "type": "list", "elements": 'int'}, + "ip_addresses": {"required": False, "type": "list", "elements": 'str'}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "name": {"type": "str"}, - "group_id": {"type": "int"}, - "state": {"required": False, "type": "str", "choices": ["present", "absent"], "default": "present"}, - "device_service_tags": {"required": False, "type": "list", "elements": 'str'}, - "device_ids": {"required": False, "type": "list", "elements": 'int'}, - "ip_addresses": {"required": False, "type": "list", "elements": 'str'}, - }, + argument_spec=specs, required_if=( - ['validate_certs', True, ['ca_path']], ["state", "present", ("device_ids", "device_service_tags", "ip_addresses"), True], ), mutually_exclusive=( diff --git a/plugins/modules/ome_device_info.py b/plugins/modules/ome_device_info.py index dd8db00b0..10df0b8cf 100644 --- a/plugins/modules/ome_device_info.py +++ b/plugins/modules/ome_device_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 Dell Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) @@ -198,7 +198,7 @@ from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -372,22 +372,16 @@ def main(): "filter": {"type": 'str', "required": False}, }} + specs = { + "fact_subset": {"required": False, "default": "basic_inventory", + "choices": ['basic_inventory', 'detailed_inventory', 'subsystem_health']}, + "system_query_options": system_query_options, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "fact_subset": {"required": False, "default": "basic_inventory", - "choices": ['basic_inventory', 'detailed_inventory', 'subsystem_health']}, - "system_query_options": system_query_options, - }, + argument_spec=specs, required_if=[['fact_subset', 'detailed_inventory', ['system_query_options']], - ['fact_subset', 'subsystem_health', ['system_query_options']], - ['validate_certs', True, ['ca_path']]], + ['fact_subset', 'subsystem_health', ['system_query_options']]], supports_check_mode=True) try: diff --git a/plugins/modules/ome_device_local_access_configuration.py b/plugins/modules/ome_device_local_access_configuration.py index 757d1e9d2..9b48e33dd 100644 --- a/plugins/modules/ome_device_local_access_configuration.py +++ b/plugins/modules/ome_device_local_access_configuration.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -262,7 +262,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params DOMAIN_URI = "ManagementDomainService/Domains" DEVICE_URI = "DeviceService/Devices" @@ -429,35 +429,29 @@ def main(): "lcd_access": {"type": "str", "required": False, "choices": ["VIEW_AND_MODIFY", "VIEW_ONLY", "DISABLED"]}, "user_defined": {"type": "str", "required": False}, "lcd_language": {"type": "str", "required": False}} - module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "device_id": {"required": False, "type": "int"}, - "device_service_tag": {"required": False, "type": "str"}, - "enable_kvm_access": {"required": False, "type": "bool"}, - "enable_chassis_direct_access": {"required": False, "type": "bool"}, - "chassis_power_button": { - "required": False, "type": "dict", "options": chassis_power, - "required_if": [["enable_lcd_override_pin", True, ("disabled_button_lcd_override_pin",)]], - }, - "quick_sync": { - "required": False, "type": "dict", "options": quick_sync_options, - "required_if": [["enable_inactivity_timeout", True, ("timeout_limit", "timeout_limit_unit")]] - }, - "lcd": { - "required": False, "type": "dict", "options": lcd_options, - }, + specs = { + "device_id": {"required": False, "type": "int"}, + "device_service_tag": {"required": False, "type": "str"}, + "enable_kvm_access": {"required": False, "type": "bool"}, + "enable_chassis_direct_access": {"required": False, "type": "bool"}, + "chassis_power_button": { + "required": False, "type": "dict", "options": chassis_power, + "required_if": [["enable_lcd_override_pin", True, ("disabled_button_lcd_override_pin",)]], + }, + "quick_sync": { + "required": False, "type": "dict", "options": quick_sync_options, + "required_if": [["enable_inactivity_timeout", True, ("timeout_limit", "timeout_limit_unit")]] + }, + "lcd": { + "required": False, "type": "dict", "options": lcd_options, }, + } + specs.update(ome_auth_params) + module = AnsibleModule( + argument_spec=specs, mutually_exclusive=[('device_id', 'device_service_tag')], required_one_of=[["enable_kvm_access", "enable_chassis_direct_access", "chassis_power_button", "quick_sync", "lcd"]], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True, ) try: diff --git a/plugins/modules/ome_device_location.py b/plugins/modules/ome_device_location.py index 9a071c9f1..96a61a29b 100644 --- a/plugins/modules/ome_device_location.py +++ b/plugins/modules/ome_device_location.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -156,7 +156,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params LOCATION_API = "DeviceService/Devices({0})/Settings('Location')" DEVICE_URI = "DeviceService/Devices" @@ -268,26 +268,20 @@ def device_validation(module, rest_obj): def main(): + specs = { + "device_id": {"required": False, "type": "int"}, + "device_service_tag": {"required": False, "type": "str"}, + "data_center": {"required": False, "type": "str"}, + "room": {"required": False, "type": "str"}, + "aisle": {"required": False, "type": "str"}, + "rack": {"required": False, "type": "str"}, + "rack_slot": {"required": False, "type": "int"}, + "location": {"required": False, "type": "str"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "device_id": {"required": False, "type": "int"}, - "device_service_tag": {"required": False, "type": "str"}, - "data_center": {"required": False, "type": "str"}, - "room": {"required": False, "type": "str"}, - "aisle": {"required": False, "type": "str"}, - "rack": {"required": False, "type": "str"}, - "rack_slot": {"required": False, "type": "int"}, - "location": {"required": False, "type": "str"}, - }, + argument_spec=specs, mutually_exclusive=[('device_id', 'device_service_tag')], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True ) try: diff --git a/plugins/modules/ome_device_mgmt_network.py b/plugins/modules/ome_device_mgmt_network.py index f4f3ea26d..e895472ea 100644 --- a/plugins/modules/ome_device_mgmt_network.py +++ b/plugins/modules/ome_device_mgmt_network.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -373,7 +373,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.common.dict_transformations import recursive_diff DEVICE_URI = "DeviceService/Devices" @@ -709,56 +709,50 @@ def main(): dns_server_settings = {"preferred_dns_server": {"type": 'str'}, "alternate_dns_server1": {"type": 'str'}, "alternate_dns_server2": {"type": 'str'}} + specs = { + "enable_nic": {"type": 'bool', "default": True}, + "device_id": {"type": 'int'}, + "device_service_tag": {"type": 'str'}, + "delay": {"type": 'int', "default": 0}, + "ipv4_configuration": + {"type": "dict", "options": ipv4_options, + "required_if": [ + ['enable_ipv4', True, ('enable_dhcp',), True], + ['enable_dhcp', False, ('static_ip_address', 'static_subnet_mask', "static_gateway"), False], + ['use_dhcp_to_obtain_dns_server_address', False, + ('static_preferred_dns_server', 'static_alternate_dns_server'), True]] + }, + "ipv6_configuration": + {"type": "dict", "options": ipv6_options, + "required_if": [ + ['enable_ipv6', True, ('enable_auto_configuration',), True], + ['enable_auto_configuration', False, + ('static_ip_address', 'static_prefix_length', "static_gateway"), False], + ['use_dhcpv6_to_obtain_dns_server_address', False, + ('static_preferred_dns_server', 'static_alternate_dns_server'), True]] + }, + "dns_configuration": + {"type": "dict", "options": dns_options, + "required_if": [ + ['register_with_dns', True, ('dns_name',), False], + ['use_dhcp_for_dns_domain_name', False, ('dns_domain_name',)], + ['auto_negotiation', False, ('network_speed',)]] + }, + "management_vlan": + {"type": "dict", "options": management_vlan, + "required_if": [ + ['enable_vlan', True, ('vlan_id',), True]] + }, + "dns_server_settings": + {"type": "dict", "options": dns_server_settings, + "required_one_of": [("preferred_dns_server", "alternate_dns_server1", "alternate_dns_server2")] + } + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "enable_nic": {"type": 'bool', "default": True}, - "device_id": {"type": 'int'}, - "device_service_tag": {"type": 'str'}, - "delay": {"type": 'int', "default": 0}, - "ipv4_configuration": - {"type": "dict", "options": ipv4_options, - "required_if": [ - ['enable_ipv4', True, ('enable_dhcp',), True], - ['enable_dhcp', False, ('static_ip_address', 'static_subnet_mask', "static_gateway"), False], - ['use_dhcp_to_obtain_dns_server_address', False, - ('static_preferred_dns_server', 'static_alternate_dns_server'), True]] - }, - "ipv6_configuration": - {"type": "dict", "options": ipv6_options, - "required_if": [ - ['enable_ipv6', True, ('enable_auto_configuration',), True], - ['enable_auto_configuration', False, - ('static_ip_address', 'static_prefix_length', "static_gateway"), False], - ['use_dhcpv6_to_obtain_dns_server_address', False, - ('static_preferred_dns_server', 'static_alternate_dns_server'), True]] - }, - "dns_configuration": - {"type": "dict", "options": dns_options, - "required_if": [ - ['register_with_dns', True, ('dns_name',), False], - ['use_dhcp_for_dns_domain_name', False, ('dns_domain_name',)], - ['auto_negotiation', False, ('network_speed',)]] - }, - "management_vlan": - {"type": "dict", "options": management_vlan, - "required_if": [ - ['enable_vlan', True, ('vlan_id',), True]] - }, - "dns_server_settings": - {"type": "dict", "options": dns_server_settings, - "required_one_of": [("preferred_dns_server", "alternate_dns_server1", "alternate_dns_server2")] - } - }, + argument_spec=specs, required_one_of=[('device_id', 'device_service_tag')], mutually_exclusive=[('device_id', 'device_service_tag')], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True ) try: diff --git a/plugins/modules/ome_device_network_services.py b/plugins/modules/ome_device_network_services.py index 77567c6b6..81475d48b 100644 --- a/plugins/modules/ome_device_network_services.py +++ b/plugins/modules/ome_device_network_services.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -195,7 +195,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params DOMAIN_URI = "ManagementDomainService/Domains" DEVICE_URI = "DeviceService/Devices" @@ -361,25 +361,19 @@ def main(): "max_auth_retries": {"type": "int", "required": False}, "idle_timeout": {"type": "float", "required": False}} racadm_options = {"enabled": {"type": "bool", "required": True}} + specs = { + "device_id": {"required": False, "type": "int"}, + "device_service_tag": {"required": False, "type": "str"}, + "snmp_settings": {"type": "dict", "required": False, "options": snmp_options, + "required_if": [["enabled", True, ("community_name",)]]}, + "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( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "device_id": {"required": False, "type": "int"}, - "device_service_tag": {"required": False, "type": "str"}, - "snmp_settings": {"type": "dict", "required": False, "options": snmp_options, - "required_if": [["enabled", True, ("community_name",)]]}, - "ssh_settings": {"type": "dict", "required": False, "options": ssh_options}, - "remote_racadm_settings": {"type": "dict", "required": False, "options": racadm_options}, - }, + argument_spec=specs, mutually_exclusive=[('device_id', 'device_service_tag')], required_one_of=[["snmp_settings", "ssh_settings", "remote_racadm_settings"]], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True, ) if not any([module.params.get("snmp_settings"), module.params.get("ssh_settings"), diff --git a/plugins/modules/ome_device_power_settings.py b/plugins/modules/ome_device_power_settings.py index afb4273eb..ec99e693a 100644 --- a/plugins/modules/ome_device_power_settings.py +++ b/plugins/modules/ome_device_power_settings.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -171,7 +171,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params POWER_API = "DeviceService/Devices({0})/Settings('Power')" DEVICE_URI = "DeviceService/Devices" DOMAIN_URI = "ManagementDomainService/Domains" @@ -305,26 +305,20 @@ def main(): hot_spare_options = {"enable_hot_spare": {"required": True, "type": "bool"}, "primary_grid": {"required": False, "type": "str", "default": "GRID_1", "choices": ["GRID_1", "GRID_2"]}} + specs = { + "device_id": {"required": False, "type": "int"}, + "device_service_tag": {"required": False, "type": "str"}, + "power_configuration": {"type": "dict", "required": False, "options": power_options, + "required_if": [["enable_power_cap", True, ("power_cap",), True]]}, + "redundancy_configuration": {"type": "dict", "required": False, "options": redundancy_options}, + "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( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "device_id": {"required": False, "type": "int"}, - "device_service_tag": {"required": False, "type": "str"}, - "power_configuration": {"type": "dict", "required": False, "options": power_options, - "required_if": [["enable_power_cap", True, ("power_cap",), True]]}, - "redundancy_configuration": {"type": "dict", "required": False, "options": redundancy_options}, - "hot_spare_configuration": {"type": "dict", "required": False, "options": hot_spare_options, - "required_if": [["enable_hot_spare", True, ("primary_grid",)]]}, - }, + argument_spec=specs, mutually_exclusive=[('device_id', 'device_service_tag')], required_one_of=[["power_configuration", "redundancy_configuration", "hot_spare_configuration"]], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True, ) try: diff --git a/plugins/modules/ome_device_quick_deploy.py b/plugins/modules/ome_device_quick_deploy.py index 84e354e79..183b7f67e 100644 --- a/plugins/modules/ome_device_quick_deploy.py +++ b/plugins/modules/ome_device_quick_deploy.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2022 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) @@ -350,7 +350,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params DOMAIN_URI = "ManagementDomainService/Domains" DEVICE_URI = "DeviceService/Devices" @@ -625,14 +625,7 @@ def main(): "ipv6_gateway": {"type": "str"}, "slots": {"type": "list", "elements": "dict", "options": slots}, } - argument_spec = { - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, + specs = { "device_id": {"required": False, "type": "int"}, "device_service_tag": {"required": False, "type": "str"}, "setting_type": {"required": True, "choices": ["ServerQuickDeploy", "IOMQuickDeploy"]}, @@ -648,9 +641,9 @@ def main(): "job_wait": {"type": "bool", "default": True}, "job_wait_timeout": {"type": "int", "default": 120}, } - module = AnsibleModule(argument_spec=argument_spec, + specs.update(ome_auth_params) + module = AnsibleModule(argument_spec=specs, mutually_exclusive=[('device_id', 'device_service_tag')], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True,) if module.params["quick_deploy_options"] is None: module.fail_json(msg="missing required arguments: quick_deploy_options") diff --git a/plugins/modules/ome_diagnostics.py b/plugins/modules/ome_diagnostics.py index 4869ef45b..34ca56f38 100644 --- a/plugins/modules/ome_diagnostics.py +++ b/plugins/modules/ome_diagnostics.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -255,7 +255,7 @@ import re from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params 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} @@ -383,35 +383,29 @@ def find_failed_jobs(resp, rest_obj): def main(): + specs = { + "device_ids": {"required": False, "type": "list", "elements": "int"}, + "device_service_tags": {"required": False, "type": "list", "elements": "str"}, + "device_group_name": {"required": False, "type": "str"}, + "log_type": {"required": False, "type": "str", "default": "support_assist_collection", + "choices": ["support_assist_collection", "application"]}, + "mask_sensitive_info": {"required": False, "type": "bool", "default": False}, + "log_selectors": {"required": False, "type": "list", + "choices": ["RAID_LOGS", "OS_LOGS"], "elements": "str"}, + "share_address": {"required": True, "type": "str"}, + "share_name": {"required": True, "type": "str"}, + "share_type": {"required": True, "type": "str", "choices": ["NFS", "CIFS"]}, + "share_user": {"required": False, "type": "str"}, + "share_password": {"required": False, "type": "str", "no_log": True}, + "share_domain": {"required": False, "type": "str"}, + "job_wait": {"required": False, "type": "bool", "default": True}, + "job_wait_timeout": {"required": False, "type": "int", "default": 60}, + "test_connection": {"required": False, "type": "bool", "default": False}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "device_ids": {"required": False, "type": "list", "elements": "int"}, - "device_service_tags": {"required": False, "type": "list", "elements": "str"}, - "device_group_name": {"required": False, "type": "str"}, - "log_type": {"required": False, "type": "str", "default": "support_assist_collection", - "choices": ["support_assist_collection", "application"]}, - "mask_sensitive_info": {"required": False, "type": "bool", "default": False}, - "log_selectors": {"required": False, "type": "list", - "choices": ["RAID_LOGS", "OS_LOGS"], "elements": "str"}, - "share_address": {"required": True, "type": "str"}, - "share_name": {"required": True, "type": "str"}, - "share_type": {"required": True, "type": "str", "choices": ["NFS", "CIFS"]}, - "share_user": {"required": False, "type": "str"}, - "share_password": {"required": False, "type": "str", "no_log": True}, - "share_domain": {"required": False, "type": "str"}, - "job_wait": {"required": False, "type": "bool", "default": True}, - "job_wait_timeout": {"required": False, "type": "int", "default": 60}, - "test_connection": {"required": False, "type": "bool", "default": False}, - }, + argument_spec=specs, required_if=[ - ['validate_certs', True, ['ca_path']], ['log_type', 'application', ['mask_sensitive_info']], ['log_type', 'support_assist_collection', ['device_ids', 'device_service_tags', 'device_group_name'], True], diff --git a/plugins/modules/ome_discovery.py b/plugins/modules/ome_discovery.py index ba7ae9349..a4fde99f9 100644 --- a/plugins/modules/ome_discovery.py +++ b/plugins/modules/ome_discovery.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -624,7 +624,7 @@ import time from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict @@ -1011,35 +1011,29 @@ def main(): "ssh": {"type": 'dict', "options": ssh_creds}, "ipmi": {"type": 'dict', "options": ipmi_creds}, } + specs = { + "discovery_job_name": {"type": 'str'}, + "discovery_id": {"type": 'int'}, + "state": {"default": "present", "choices": ['present', 'absent']}, + "new_name": {"type": 'str'}, + "discovery_config_targets": + {"type": 'list', "elements": 'dict', "options": DiscoveryConfigModel, + "required_one_of": [ + ('wsman', 'storage', 'redfish', 'vmware', 'snmp', 'ssh', 'ipmi') + ]}, + "schedule": {"default": 'RunNow', "choices": ['RunNow', 'RunLater']}, + "cron": {"type": 'str'}, + "job_wait": {"type": 'bool', "default": True}, + "job_wait_timeout": {"type": 'int', "default": 10800}, + "trap_destination": {"type": 'bool', "default": False}, + "community_string": {"type": 'bool', "default": False}, + "email_recipient": {"type": 'str'}, + "ignore_partial_failure": {"type": 'bool', "default": False} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "discovery_job_name": {"type": 'str'}, - "discovery_id": {"type": 'int'}, - "state": {"default": "present", "choices": ['present', 'absent']}, - "new_name": {"type": 'str'}, - "discovery_config_targets": - {"type": 'list', "elements": 'dict', "options": DiscoveryConfigModel, - "required_one_of": [ - ('wsman', 'storage', 'redfish', 'vmware', 'snmp', 'ssh', 'ipmi') - ]}, - "schedule": {"default": 'RunNow', "choices": ['RunNow', 'RunLater']}, - "cron": {"type": 'str'}, - "job_wait": {"type": 'bool', "default": True}, - "job_wait_timeout": {"type": 'int', "default": 10800}, - "trap_destination": {"type": 'bool', "default": False}, - "community_string": {"type": 'bool', "default": False}, - "email_recipient": {"type": 'str'}, - "ignore_partial_failure": {"type": 'bool', "default": False} - }, + argument_spec=specs, required_if=[ - ['validate_certs', True, ['ca_path']], ['state', 'present', ('discovery_config_targets',)], ['schedule', 'RunLater', ('cron',)] ], diff --git a/plugins/modules/ome_domain_user_groups.py b/plugins/modules/ome_domain_user_groups.py index 4aa248c44..7b74c306e 100644 --- a/plugins/modules/ome_domain_user_groups.py +++ b/plugins/modules/ome_domain_user_groups.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -165,7 +165,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError ROLE_URI = "AccountService/Roles" @@ -302,26 +302,20 @@ def delete_directory_user(rest_obj, user_id): def main(): + specs = { + "state": {"required": False, "type": 'str', "default": "present", + "choices": ['present', 'absent']}, + "group_name": {"required": True, "type": 'str'}, + "role": {"required": False, "type": 'str'}, + "directory_name": {"required": False, "type": 'str'}, + "directory_id": {"required": False, "type": 'int'}, + "domain_username": {"required": False, "type": 'str'}, + "domain_password": {"required": False, "type": 'str', "no_log": True}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"required": False, "type": 'str', "default": "present", - "choices": ['present', 'absent']}, - "group_name": {"required": True, "type": 'str'}, - "role": {"required": False, "type": 'str'}, - "directory_name": {"required": False, "type": 'str'}, - "directory_id": {"required": False, "type": 'int'}, - "domain_username": {"required": False, "type": 'str'}, - "domain_password": {"required": False, "type": 'str', "no_log": True}, - }, + argument_spec=specs, mutually_exclusive=[['directory_name', 'directory_id'], ], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True) try: with RestOME(module.params, req_session=True) as rest_obj: diff --git a/plugins/modules/ome_firmware.py b/plugins/modules/ome_firmware.py index dd929435f..a3bfff955 100644 --- a/plugins/modules/ome_firmware.py +++ b/plugins/modules/ome_firmware.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -324,7 +324,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -597,33 +597,28 @@ def validate_inputs(module): def main(): - module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "device_service_tag": {"type": "list", "elements": 'str'}, - "device_id": {"type": "list", "elements": 'int'}, - "dup_file": {"type": "path"}, - "device_group_names": {"type": "list", "elements": 'str'}, - "components": {"type": "list", "elements": 'str', "default": []}, - "baseline_name": {"type": "str"}, - "schedule": {"type": 'str', "choices": ['RebootNow', 'StageForNextReboot'], "default": 'RebootNow'}, - "devices": { - "type": 'list', "elements": 'dict', - "options": { - "id": {'type': 'int'}, - "service_tag": {"type": 'str'}, - "components": {"type": "list", "elements": 'str', "default": []}, - }, - "mutually_exclusive": [('id', 'service_tag')], - "required_one_of": [('id', 'service_tag')] + specs = { + "device_service_tag": {"type": "list", "elements": 'str'}, + "device_id": {"type": "list", "elements": 'int'}, + "dup_file": {"type": "path"}, + "device_group_names": {"type": "list", "elements": 'str'}, + "components": {"type": "list", "elements": 'str', "default": []}, + "baseline_name": {"type": "str"}, + "schedule": {"type": 'str', "choices": ['RebootNow', 'StageForNextReboot'], "default": 'RebootNow'}, + "devices": { + "type": 'list', "elements": 'dict', + "options": { + "id": {'type': 'int'}, + "service_tag": {"type": 'str'}, + "components": {"type": "list", "elements": 'str', "default": []}, }, + "mutually_exclusive": [('id', 'service_tag')], + "required_one_of": [('id', 'service_tag')] }, + } + specs.update(ome_auth_params) + module = AnsibleModule( + argument_spec=specs, required_one_of=[["dup_file", "baseline_name"]], mutually_exclusive=[ ["baseline_name", "dup_file"], @@ -631,7 +626,6 @@ def main(): ["device_group_names", "device_service_tag", "devices"], ["baseline_name", "device_group_names"], ["dup_file", "components", "devices"]], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True ) validate_inputs(module) diff --git a/plugins/modules/ome_firmware_baseline.py b/plugins/modules/ome_firmware_baseline.py index 235590799..d6282db3a 100644 --- a/plugins/modules/ome_firmware_baseline.py +++ b/plugins/modules/ome_firmware_baseline.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -269,7 +269,7 @@ import time from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params 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 @@ -499,35 +499,29 @@ def delete_baseline(module, rest_obj, baseline_list): def main(): + specs = { + "state": {"default": "present", "choices": ['present', 'absent']}, + "baseline_name": {"type": 'str'}, + "baseline_id": {"type": 'int'}, + "baseline_description": {"type": 'str'}, + "new_baseline_name": {"type": 'str'}, + "catalog_name": {"type": 'str'}, + "downgrade_enabled": {"type": 'bool'}, + "is_64_bit": {"type": 'bool'}, + "device_ids": {"type": 'list', "elements": 'int'}, + "device_service_tags": {"type": 'list', "elements": 'str'}, + "device_group_names": {"type": 'list', "elements": 'str'}, + "job_wait": {"type": 'bool', "default": True}, + "job_wait_timeout": {"type": 'int', "default": 600} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"default": "present", "choices": ['present', 'absent']}, - "baseline_name": {"type": 'str'}, - "baseline_id": {"type": 'int'}, - "baseline_description": {"type": 'str'}, - "new_baseline_name": {"type": 'str'}, - "catalog_name": {"type": 'str'}, - "downgrade_enabled": {"type": 'bool'}, - "is_64_bit": {"type": 'bool'}, - "device_ids": {"type": 'list', "elements": 'int'}, - "device_service_tags": {"type": 'list', "elements": 'str'}, - "device_group_names": {"type": 'list', "elements": 'str'}, - "job_wait": {"type": 'bool', "default": True}, - "job_wait_timeout": {"type": 'int', "default": 600} - }, + argument_spec=specs, mutually_exclusive=[ ('device_ids', 'device_service_tags', 'device_group_names'), ('baseline_name', 'baseline_id') ], required_one_of=[('baseline_name', 'baseline_id')], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True) try: diff --git a/plugins/modules/ome_firmware_baseline_compliance_info.py b/plugins/modules/ome_firmware_baseline_compliance_info.py index bbe9f82ae..da0c8f47a 100644 --- a/plugins/modules/ome_firmware_baseline_compliance_info.py +++ b/plugins/modules/ome_firmware_baseline_compliance_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -226,7 +226,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -371,23 +371,17 @@ def validate_inputs(module): def main(): + specs = { + "baseline_name": {"type": 'str', "required": False}, + "device_service_tags": {"required": False, "type": "list", "elements": 'str'}, + "device_ids": {"required": False, "type": "list", "elements": 'int'}, + "device_group_names": {"required": False, "type": "list", "elements": 'str'}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "baseline_name": {"type": 'str', "required": False}, - "device_service_tags": {"required": False, "type": "list", "elements": 'str'}, - "device_ids": {"required": False, "type": "list", "elements": 'int'}, - "device_group_names": {"required": False, "type": "list", "elements": 'str'}, - }, + 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']], - required_if=[['validate_certs', True, ['ca_path']]], supports_check_mode=True ) try: diff --git a/plugins/modules/ome_firmware_baseline_info.py b/plugins/modules/ome_firmware_baseline_info.py index 228171250..b6fc43b47 100644 --- a/plugins/modules/ome_firmware_baseline_info.py +++ b/plugins/modules/ome_firmware_baseline_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -102,7 +102,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -121,18 +121,12 @@ def get_specific_baseline(module, baseline_name, resp_data): def main(): + specs = { + "baseline_name": {"type": 'str', "required": False}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "baseline_name": {"type": 'str', "required": False}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True ) try: diff --git a/plugins/modules/ome_firmware_catalog.py b/plugins/modules/ome_firmware_catalog.py index 18f39579f..29b7ed905 100644 --- a/plugins/modules/ome_firmware_catalog.py +++ b/plugins/modules/ome_firmware_catalog.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -353,7 +353,7 @@ import time from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -590,34 +590,28 @@ def perform_present_action(module, rest_obj, requested_catalog_list, all_catalog def main(): + specs = { + "state": {"default": "present", "choices": ['present', 'absent']}, + "catalog_name": {"type": 'list', "elements": 'str'}, + "new_catalog_name": {"type": 'str'}, + "catalog_id": {"type": 'list', "elements": 'int'}, + "catalog_description": {"required": False, "type": 'str'}, + "source": {"required": False, "type": 'str'}, + "source_path": {"required": False, "type": 'str'}, + "file_name": {"required": False, "type": 'str'}, + "repository_type": {"required": False, + "choices": ["NFS", "CIFS", "HTTP", "HTTPS", "DELL_ONLINE"]}, + "repository_username": {"required": False, "type": 'str'}, + "repository_password": {"required": False, "type": 'str', "no_log": True}, + "repository_domain": {"required": False, "type": 'str'}, + "check_certificate": {"required": False, "type": 'bool', "default": False}, + "job_wait": {"type": 'bool', "default": True}, + "job_wait_timeout": {"type": 'int', "default": 600} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"default": "present", "choices": ['present', 'absent']}, - "catalog_name": {"type": 'list', "elements": 'str'}, - "new_catalog_name": {"type": 'str'}, - "catalog_id": {"type": 'list', "elements": 'int'}, - "catalog_description": {"required": False, "type": 'str'}, - "source": {"required": False, "type": 'str'}, - "source_path": {"required": False, "type": 'str'}, - "file_name": {"required": False, "type": 'str'}, - "repository_type": {"required": False, - "choices": ["NFS", "CIFS", "HTTP", "HTTPS", "DELL_ONLINE"]}, - "repository_username": {"required": False, "type": 'str'}, - "repository_password": {"required": False, "type": 'str', "no_log": True}, - "repository_domain": {"required": False, "type": 'str'}, - "check_certificate": {"required": False, "type": 'bool', "default": False}, - "job_wait": {"type": 'bool', "default": True}, - "job_wait_timeout": {"type": 'int', "default": 600} - }, + argument_spec=specs, required_if=[ - ['validate_certs', True, ['ca_path']], ['state', 'present', ['repository_type'], False], ['state', 'present', diff --git a/plugins/modules/ome_groups.py b/plugins/modules/ome_groups.py index a70835b17..411a6221a 100644 --- a/plugins/modules/ome_groups.py +++ b/plugins/modules/ome_groups.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -197,7 +197,7 @@ 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params GROUP_URI = "GroupService/Groups" OP_URI = "GroupService/Actions/GroupService.{op}Group" @@ -397,25 +397,19 @@ def delete_groups(rest_obj, module, group_set, group_dict): def main(): + specs = { + "name": {"type": "list", "elements": 'str'}, + "group_id": {"type": "list", "elements": 'int'}, + "state": {"type": "str", "choices": ["present", "absent"], "default": "present"}, + "description": {"type": "str"}, + "new_name": {"type": "str"}, + "parent_group_name": {"type": "str", "default": STATIC_ROOT}, + "parent_group_id": {"type": "int"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "name": {"type": "list", "elements": 'str'}, - "group_id": {"type": "list", "elements": 'int'}, - "state": {"type": "str", "choices": ["present", "absent"], "default": "present"}, - "description": {"type": "str"}, - "new_name": {"type": "str"}, - "parent_group_name": {"type": "str", "default": STATIC_ROOT}, - "parent_group_id": {"type": "int"}, - }, + argument_spec=specs, required_if=[ - ['validate_certs', True, ['ca_path']], ["state", "present", ("new_name", "description", "parent_group_name", "parent_group_id"), True], ], mutually_exclusive=[ diff --git a/plugins/modules/ome_identity_pool.py b/plugins/modules/ome_identity_pool.py index f57f6a541..e03dc96bc 100644 --- a/plugins/modules/ome_identity_pool.py +++ b/plugins/modules/ome_identity_pool.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -264,7 +264,7 @@ import binascii from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -560,27 +560,21 @@ def main(): "type": "dict"}} fc_settings = {"starting_address": {"type": "str"}, "identity_count": {"type": "int"}} + specs = { + "state": {"type": "str", "required": False, "default": "present", "choices": ['present', 'absent']}, + "pool_name": {"required": True, "type": "str"}, + "new_pool_name": {"required": False, "type": "str"}, + "pool_description": {"required": False, "type": "str"}, + "ethernet_settings": {"required": False, "type": "dict", + "options": settings_options}, + "fcoe_settings": {"required": False, "type": "dict", "options": settings_options}, + "iscsi_settings": {"required": False, "type": "dict", + "options": iscsi_specific_settings}, + "fc_settings": {"required": False, "type": "dict", "options": fc_settings}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"type": "str", "required": False, "default": "present", "choices": ['present', 'absent']}, - "pool_name": {"required": True, "type": "str"}, - "new_pool_name": {"required": False, "type": "str"}, - "pool_description": {"required": False, "type": "str"}, - "ethernet_settings": {"required": False, "type": "dict", - "options": settings_options}, - "fcoe_settings": {"required": False, "type": "dict", "options": settings_options}, - "iscsi_settings": {"required": False, "type": "dict", - "options": iscsi_specific_settings}, - "fc_settings": {"required": False, "type": "dict", "options": fc_settings}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=False ) try: diff --git a/plugins/modules/ome_job_info.py b/plugins/modules/ome_job_info.py index 80b884c1e..26b0d545e 100644 --- a/plugins/modules/ome_job_info.py +++ b/plugins/modules/ome_job_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -135,7 +135,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -155,23 +155,17 @@ def _get_query_parameters(module_params): def main(): + specs = { + "job_id": {"required": False, "type": 'int'}, + "system_query_options": {"required": False, "type": 'dict', "options": { + "top": {"type": 'int', "required": False}, + "skip": {"type": 'int', "required": False}, + "filter": {"type": 'str', "required": False}, + }}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "job_id": {"required": False, "type": 'int'}, - "system_query_options": {"required": False, "type": 'dict', "options": { - "top": {"type": 'int', "required": False}, - "skip": {"type": 'int', "required": False}, - "filter": {"type": 'str', "required": False}, - }}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True ) diff --git a/plugins/modules/ome_network_port_breakout.py b/plugins/modules/ome_network_port_breakout.py index 2521bea07..08e307c78 100644 --- a/plugins/modules/ome_network_port_breakout.py +++ b/plugins/modules/ome_network_port_breakout.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -127,7 +127,7 @@ import re from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -253,19 +253,13 @@ def set_breakout(module, rest_obj, breakout_config, breakout_capability, interfa def main(): + specs = { + "target_port": {"required": True, "type": 'str'}, + "breakout_type": {"required": True, "type": 'str'}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "target_port": {"required": True, "type": 'str'}, - "breakout_type": {"required": True, "type": 'str'}, - }, - required_if=[['validate_certs', True, ['ca_path']]], + argument_spec=specs, supports_check_mode=True ) try: diff --git a/plugins/modules/ome_network_vlan.py b/plugins/modules/ome_network_vlan.py index 9f86203bc..8dbfe8236 100644 --- a/plugins/modules/ome_network_vlan.py +++ b/plugins/modules/ome_network_vlan.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -184,7 +184,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -305,29 +305,23 @@ def check_existing_vlan(module, rest_obj): def main(): + specs = { + "state": {"required": False, "choices": ['present', 'absent'], "default": "present"}, + "name": {"required": True, "type": "str"}, + "new_name": {"required": False, "type": "str"}, + "description": {"required": False, "type": "str"}, + "vlan_minimum": {"required": False, "type": "int"}, + "vlan_maximum": {"required": False, "type": "int"}, + "type": {"required": False, "type": "str", + "choices": ['General Purpose (Bronze)', 'General Purpose (Silver)', 'General Purpose (Gold)', + 'General Purpose (Platinum)', 'Cluster Interconnect', 'Hypervisor Management', + 'Storage - iSCSI', 'Storage - FCoE', 'Storage - Data Replication', 'VM Migration', + 'VMWare FT Logging']} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"required": False, "choices": ['present', 'absent'], "default": "present"}, - "name": {"required": True, "type": "str"}, - "new_name": {"required": False, "type": "str"}, - "description": {"required": False, "type": "str"}, - "vlan_minimum": {"required": False, "type": "int"}, - "vlan_maximum": {"required": False, "type": "int"}, - "type": {"required": False, "type": "str", - "choices": ['General Purpose (Bronze)', 'General Purpose (Silver)', 'General Purpose (Gold)', - 'General Purpose (Platinum)', 'Cluster Interconnect', 'Hypervisor Management', - 'Storage - iSCSI', 'Storage - FCoE', 'Storage - Data Replication', 'VM Migration', - 'VMWare FT Logging']} - }, - required_if=[['state', 'present', ('new_name', 'description', 'vlan_minimum', 'vlan_maximum', 'type',), True], - ['validate_certs', True, ['ca_path']]], + argument_spec=specs, + required_if=[['state', 'present', ('new_name', 'description', 'vlan_minimum', 'vlan_maximum', 'type',), True]], supports_check_mode=True ) try: diff --git a/plugins/modules/ome_network_vlan_info.py b/plugins/modules/ome_network_vlan_info.py index 9d88b9ae4..f1de512be 100644 --- a/plugins/modules/ome_network_vlan_info.py +++ b/plugins/modules/ome_network_vlan_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -152,7 +152,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -212,20 +212,14 @@ def get_network_type_and_qos_type_information(rest_obj): def main(): + specs = { + "id": {"required": False, "type": 'int'}, + "name": {"required": False, "type": 'str'} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "id": {"required": False, "type": 'int'}, - "name": {"required": False, "type": 'str'} - }, + argument_spec=specs, mutually_exclusive=[["id", "name"]], - required_if=[['validate_certs', True, ['ca_path']], ], supports_check_mode=True) try: with RestOME(module.params, req_session=True) as rest_obj: diff --git a/plugins/modules/ome_powerstate.py b/plugins/modules/ome_powerstate.py index 9bce13ffd..7ead69f70 100644 --- a/plugins/modules/ome_powerstate.py +++ b/plugins/modules/ome_powerstate.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -158,7 +158,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -245,23 +245,17 @@ def get_device_resource(module, rest_obj): def main(): + specs = { + "power_state": {"required": True, "type": "str", + "choices": ["on", "off", "coldboot", "warmboot", "shutdown"]}, + "device_service_tag": {"required": False, "type": "str"}, + "device_id": {"required": False, "type": "int"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "power_state": {"required": True, "type": "str", - "choices": ["on", "off", "coldboot", "warmboot", "shutdown"]}, - "device_service_tag": {"required": False, "type": "str"}, - "device_id": {"required": False, "type": "int"}, - }, + argument_spec=specs, required_one_of=[["device_service_tag", "device_id"]], mutually_exclusive=[["device_service_tag", "device_id"]], - required_if=[['validate_certs', True, ['ca_path']], ], supports_check_mode=True ) try: diff --git a/plugins/modules/ome_profile.py b/plugins/modules/ome_profile.py index bc0b00ea9..eac0f3118 100644 --- a/plugins/modules/ome_profile.py +++ b/plugins/modules/ome_profile.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 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) @@ -391,7 +391,7 @@ import time from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params 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 @@ -715,37 +715,31 @@ def main(): assign_spec = {"Attributes": {"type": 'list', "elements": 'dict'}, "Options": {"type": 'dict'}, "Schedule": {"type": 'dict'}} + specs = { + "command": {"default": "create", + "choices": ['create', 'modify', 'delete', 'assign', 'unassign', 'migrate']}, + "name_prefix": {"default": "Profile", "type": 'str'}, + "name": {"type": 'str'}, + "new_name": {"type": 'str'}, + "number_of_profiles": {"default": 1, "type": 'int'}, + "template_name": {"type": 'str'}, + "template_id": {"type": "int"}, + "device_id": {"type": 'int'}, + "device_service_tag": {"type": 'str'}, + "description": {"type": 'str'}, + "boot_to_network_iso": {"type": 'dict', "options": network_iso_spec, + "required_if": [ + ['boot_to_network', True, ['share_type', 'share_ip', 'iso_path']], + ['share_type', 'CIFS', ['share_user', 'share_password']] + ]}, + "filters": {"type": 'dict'}, + "attributes": {"type": 'dict', "options": assign_spec}, + "force": {"default": False, "type": 'bool'} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "command": {"default": "create", - "choices": ['create', 'modify', 'delete', 'assign', 'unassign', 'migrate']}, - "name_prefix": {"default": "Profile", "type": 'str'}, - "name": {"type": 'str'}, - "new_name": {"type": 'str'}, - "number_of_profiles": {"default": 1, "type": 'int'}, - "template_name": {"type": 'str'}, - "template_id": {"type": "int"}, - "device_id": {"type": 'int'}, - "device_service_tag": {"type": 'str'}, - "description": {"type": 'str'}, - "boot_to_network_iso": {"type": 'dict', "options": network_iso_spec, - "required_if": [ - ['boot_to_network', True, ['share_type', 'share_ip', 'iso_path']], - ['share_type', 'CIFS', ['share_user', 'share_password']] - ]}, - "filters": {"type": 'dict'}, - "attributes": {"type": 'dict', "options": assign_spec}, - "force": {"default": False, "type": 'bool'} - }, + argument_spec=specs, required_if=[ - ['validate_certs', True, ['ca_path']], ['command', 'create', ['template_name', 'template_id'], True], ['command', 'modify', ['name']], ['command', 'modify', ['new_name', 'description', 'attributes', 'boot_to_network_iso'], True], diff --git a/plugins/modules/ome_smart_fabric.py b/plugins/modules/ome_smart_fabric.py index dbbd720b7..b4cd907eb 100644 --- a/plugins/modules/ome_smart_fabric.py +++ b/plugins/modules/ome_smart_fabric.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -180,7 +180,7 @@ import json import socket from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError from ssl import SSLError @@ -700,27 +700,21 @@ def main(): '2xMX9116n_Fabric_Switching_Engines_in_same_chassis', '2xMX9116n_Fabric_Switching_Engines_in_different_chassis' ] + specs = { + "state": {"type": "str", "required": False, "default": "present", "choices": ['present', 'absent']}, + "name": {"required": True, "type": "str"}, + "new_name": {"required": False, "type": "str"}, + "description": {"required": False, "type": "str"}, + "fabric_design": {"required": False, "type": "str", + "choices": design_choices}, + "primary_switch_service_tag": {"required": False, "type": "str"}, + "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( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"type": "str", "required": False, "default": "present", "choices": ['present', 'absent']}, - "name": {"required": True, "type": "str"}, - "new_name": {"required": False, "type": "str"}, - "description": {"required": False, "type": "str"}, - "fabric_design": {"required": False, "type": "str", - "choices": design_choices}, - "primary_switch_service_tag": {"required": False, "type": "str"}, - "secondary_switch_service_tag": {"required": False, "type": "str"}, - "override_LLDP_configuration": {"required": False, "type": "str", "choices": ['Enabled', 'Disabled']}, - }, - required_if=[['validate_certs', True, ['ca_path']], - ['state', 'present', ('new_name', 'description', 'fabric_design', 'primary_switch_service_tag', + argument_spec=specs, + required_if=[['state', 'present', ('new_name', 'description', 'fabric_design', 'primary_switch_service_tag', 'secondary_switch_service_tag', 'override_LLDP_configuration',), True]], supports_check_mode=True ) diff --git a/plugins/modules/ome_smart_fabric_uplink.py b/plugins/modules/ome_smart_fabric_uplink.py index 9ca5d8dd2..dc3f13d4c 100644 --- a/plugins/modules/ome_smart_fabric_uplink.py +++ b/plugins/modules/ome_smart_fabric_uplink.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -273,7 +273,7 @@ from ansible.module_utils.urls import open_url, 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 +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params FABRIC_URI = "NetworkService/Fabrics" UPLINKS_URI = "NetworkService/Fabrics('{fabric_id}')/Uplinks" @@ -491,33 +491,27 @@ def modify_uplink(module, rest_obj, fabric_id, uplink_id, uplinks): def main(): + specs = { + "state": {"required": False, "choices": ['present', 'absent'], "default": "present"}, + "fabric_name": {"required": True, "type": "str"}, + "name": {"required": True, "type": "str"}, + "new_name": {"required": False, "type": "str"}, + "description": {"required": False, "type": "str"}, + "uplink_type": {"required": False, + "choices": ['Ethernet', 'FCoE', 'FC Gateway', 'FC Direct Attach', + 'Ethernet - No Spanning Tree']}, + "ufd_enable": {"required": False, "choices": ['Enabled', 'Disabled']}, + "primary_switch_service_tag": {"required": False, "type": "str"}, + "primary_switch_ports": {"required": False, "type": "list", "elements": "str"}, + "secondary_switch_service_tag": {"required": False, "type": "str"}, + "secondary_switch_ports": {"required": False, "type": "list", "elements": "str"}, + "tagged_networks": {"required": False, "type": "list", "elements": "str"}, + "untagged_network": {"required": False, "type": "str"} + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"required": False, "choices": ['present', 'absent'], "default": "present"}, - "fabric_name": {"required": True, "type": "str"}, - "name": {"required": True, "type": "str"}, - "new_name": {"required": False, "type": "str"}, - "description": {"required": False, "type": "str"}, - "uplink_type": {"required": False, - "choices": ['Ethernet', 'FCoE', 'FC Gateway', 'FC Direct Attach', - 'Ethernet - No Spanning Tree']}, - "ufd_enable": {"required": False, "choices": ['Enabled', 'Disabled']}, - "primary_switch_service_tag": {"required": False, "type": "str"}, - "primary_switch_ports": {"required": False, "type": "list", "elements": "str"}, - "secondary_switch_service_tag": {"required": False, "type": "str"}, - "secondary_switch_ports": {"required": False, "type": "list", "elements": "str"}, - "tagged_networks": {"required": False, "type": "list", "elements": "str"}, - "untagged_network": {"required": False, "type": "str"} - }, - required_if=[['validate_certs', True, ['ca_path']], - ['state', 'present', + argument_spec=specs, + required_if=[['state', 'present', ('new_name', 'description', 'uplink_type', 'ufd_enable', 'primary_switch_service_tag', 'primary_switch_ports', 'secondary_switch_service_tag', 'secondary_switch_ports', 'tagged_networks', 'untagged_network',), True]], diff --git a/plugins/modules/ome_template.py b/plugins/modules/ome_template.py index e1cf8c1c6..5ce3ad188 100644 --- a/plugins/modules/ome_template.py +++ b/plugins/modules/ome_template.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -486,7 +486,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -782,26 +782,21 @@ def exit_module(module, response): def main(): + specs = { + "command": {"required": False, "default": "create", "aliases": ['state'], + "choices": ['create', 'modify', 'deploy', 'delete', 'export', 'import', 'clone']}, + "template_id": {"required": False, "type": 'int'}, + "template_name": {"required": False, "type": 'str'}, + "template_view_type": {"required": False, "default": 'Deployment', + "choices": ['Deployment', 'Compliance', 'Inventory', 'Sample', 'None']}, + "device_id": {"required": False, "type": 'list', "default": [], "elements": 'int'}, + "device_service_tag": {"required": False, "type": 'list', "default": [], "elements": 'str'}, + "device_group_names": {"required": False, "type": 'list', "default": [], "elements": 'str'}, + "attributes": {"required": False, "type": 'dict'}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "command": {"required": False, "default": "create", "aliases": ['state'], - "choices": ['create', 'modify', 'deploy', 'delete', 'export', 'import', 'clone']}, - "template_id": {"required": False, "type": 'int'}, - "template_name": {"required": False, "type": 'str'}, - "template_view_type": {"required": False, "default": 'Deployment', - "choices": ['Deployment', 'Compliance', 'Inventory', 'Sample', 'None']}, - "device_id": {"required": False, "type": 'list', "default": [], "elements": 'int'}, - "device_service_tag": {"required": False, "type": 'list', "default": [], "elements": 'str'}, - "device_group_names": {"required": False, "type": 'list', "default": [], "elements": 'str'}, - "attributes": {"required": False, "type": 'dict'}, - }, + argument_spec=specs, required_if=[ ['command', 'create', ['attributes']], ['command', 'modify', ['attributes']], @@ -812,7 +807,6 @@ def main(): ['command', 'clone', ['template_id', 'template_name'], True], ['command', 'deploy', ['template_id', 'template_name'], True], ['command', 'deploy', ['device_id', 'device_service_tag', 'device_group_names'], True], - ['validate_certs', True, ['ca_path']], ], mutually_exclusive=[["template_id", "template_name"]], supports_check_mode=False) diff --git a/plugins/modules/ome_template_identity_pool.py b/plugins/modules/ome_template_identity_pool.py index d9b8d558a..3547e19e2 100644 --- a/plugins/modules/ome_template_identity_pool.py +++ b/plugins/modules/ome_template_identity_pool.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -92,7 +92,7 @@ import json from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ssl import SSLError @@ -151,19 +151,13 @@ def get_identity_id(rest_obj, module): def main(): + specs = { + "template_name": {"required": True, "type": "str"}, + "identity_pool_name": {"required": False, "type": "str"}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "template_name": {"required": True, "type": "str"}, - "identity_pool_name": {"required": False, "type": "str"}, - }, - required_if=[['validate_certs', True, ['ca_path']], ], + argument_spec=specs, supports_check_mode=False ) try: diff --git a/plugins/modules/ome_template_info.py b/plugins/modules/ome_template_info.py index 420057afa..e233c5ac5 100644 --- a/plugins/modules/ome_template_info.py +++ b/plugins/modules/ome_template_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -125,22 +125,16 @@ def _get_query_parameters(module_params): def main(): + specs = { + "template_id": {"type": 'int', "required": False}, + "system_query_options": {"required": False, "type": 'dict', + "options": {"filter": {"type": 'str', "required": False}} + }, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "template_id": {"type": 'int', "required": False}, - "system_query_options": {"required": False, "type": 'dict', - "options": {"filter": {"type": 'str', "required": False}} - }, - }, + argument_spec=specs, mutually_exclusive=[['template_id', 'system_query_options']], - required_if=[['validate_certs', True, ['ca_path']], ], supports_check_mode=True ) template_uri = "TemplateService/Templates" diff --git a/plugins/modules/ome_template_network_vlan.py b/plugins/modules/ome_template_network_vlan.py index a00e28aca..811e058cd 100644 --- a/plugins/modules/ome_template_network_vlan.py +++ b/plugins/modules/ome_template_network_vlan.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -193,7 +193,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -421,27 +421,21 @@ def main(): port_tagged_spec = {"port": {"required": True, "type": "int"}, "tagged_network_ids": {"type": "list", "elements": "int"}, "tagged_network_names": {"type": "list", "elements": "str"}} + specs = { + "template_name": {"required": False, "type": "str"}, + "template_id": {"required": False, "type": "int"}, + "nic_identifier": {"required": True, "type": "str"}, + "untagged_networks": {"required": False, "type": "list", "elements": "dict", "options": port_untagged_spec, + "mutually_exclusive": [("untagged_network_id", "untagged_network_name")]}, + "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( - argument_spec={ - "hostname": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "port": {"required": False, "type": "int", "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "template_name": {"required": False, "type": "str"}, - "template_id": {"required": False, "type": "int"}, - "nic_identifier": {"required": True, "type": "str"}, - "untagged_networks": {"required": False, "type": "list", "elements": "dict", "options": port_untagged_spec, - "mutually_exclusive": [("untagged_network_id", "untagged_network_name")]}, - "tagged_networks": {"required": False, "type": "list", "elements": "dict", "options": port_tagged_spec}, - "propagate_vlan": {"type": "bool", "default": True} - }, + argument_spec=specs, required_one_of=[("template_id", "template_name"), ("untagged_networks", "tagged_networks")], mutually_exclusive=[("template_id", "template_name")], - required_if=[['validate_certs', True, ['ca_path']], ], supports_check_mode=True ) try: diff --git a/plugins/modules/ome_user.py b/plugins/modules/ome_user.py index 41a9f8539..c768b4ca5 100644 --- a/plugins/modules/ome_user.py +++ b/plugins/modules/ome_user.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -154,7 +154,7 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -231,24 +231,18 @@ def exit_module(module, response, http_method): def main(): + specs = { + "state": {"required": False, "type": 'str', "default": "present", + "choices": ['present', 'absent']}, + "user_id": {"required": False, "type": 'int'}, + "name": {"required": False, "type": 'str'}, + "attributes": {"required": False, "type": 'dict'}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "default": 443, "type": 'int'}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"required": False, "type": 'str', "default": "present", - "choices": ['present', 'absent']}, - "user_id": {"required": False, "type": 'int'}, - "name": {"required": False, "type": 'str'}, - "attributes": {"required": False, "type": 'dict'}, - }, + argument_spec=specs, mutually_exclusive=[['user_id', 'name'], ], - required_if=[['state', 'present', ['attributes']], - ['validate_certs', True, ['ca_path']], ], + required_if=[['state', 'present', ['attributes']], ], supports_check_mode=False) try: diff --git a/plugins/modules/ome_user_info.py b/plugins/modules/ome_user_info.py index d7e03e5e7..b42f180fe 100644 --- a/plugins/modules/ome_user_info.py +++ b/plugins/modules/ome_user_info.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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 @@ import json from ssl import SSLError from ansible.module_utils.basic import AnsibleModule -from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME +from ansible_collections.dellemc.openmanage.plugins.module_utils.ome import RestOME, ome_auth_params from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError from ansible.module_utils.urls import ConnectionError, SSLValidationError @@ -118,24 +118,18 @@ def _get_query_parameters(module_params): def main(): + specs = { + "account_id": {"type": 'int', "required": False}, + "system_query_options": {"required": False, "type": 'dict', "options": { + "filter": {"type": 'str', "required": False}, + }}, + } + specs.update(ome_auth_params) module = AnsibleModule( - argument_spec={ - "hostname": {"required": True, "type": 'str'}, - "username": {"required": True, "type": 'str'}, - "password": {"required": True, "type": 'str', "no_log": True}, - "port": {"required": False, "type": 'int', "default": 443}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "account_id": {"type": 'int', "required": False}, - "system_query_options": {"required": False, "type": 'dict', "options": { - "filter": {"type": 'str', "required": False}, - }}, - }, + argument_spec=specs, mutually_exclusive=[ ('account_id', 'system_query_options') ], - required_if=[['validate_certs', True, ['ca_path']], ], supports_check_mode=True ) account_uri = "AccountService/Accounts" diff --git a/plugins/modules/redfish_event_subscription.py b/plugins/modules/redfish_event_subscription.py index 671cf7ade..a5e90d97e 100644 --- a/plugins/modules/redfish_event_subscription.py +++ b/plugins/modules/redfish_event_subscription.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved. # GNU General Public License v3.0+ @@ -197,7 +197,7 @@ import json import os from ssl import SSLError -from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish +from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params 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 @@ -281,22 +281,19 @@ def _get_formatted_payload(obj, existing_payload): def main(): + specs = { + "destination": {"required": True, "type": "str"}, + "event_type": {"type": "str", "default": "Alert", "choices": ['Alert', 'MetricReport']}, + "event_format_type": {"type": "str", "default": "Event", + "choices": ['Event', 'MetricReport']}, + "state": {"type": "str", "default": "present", "choices": ['present', 'absent']}, + } + specs.update(redfish_auth_params) + module = AnsibleModule( - argument_spec={ - "baseuri": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "destination": {"required": True, "type": "str"}, - "event_type": {"type": "str", "default": "Alert", "choices": ['Alert', 'MetricReport']}, - "event_format_type": {"type": "str", "default": "Event", - "choices": ['Event', 'MetricReport']}, - "state": {"type": "str", "default": "present", "choices": ['present', 'absent']}, - }, - required_if=[['validate_certs', True, ['ca_path']], ], + argument_spec=specs, supports_check_mode=False) + try: _validate_inputs(module) with Redfish(module.params, req_session=True) as obj: diff --git a/plugins/modules/redfish_firmware.py b/plugins/modules/redfish_firmware.py index 3f6edc0b5..dffc1ee21 100644 --- a/plugins/modules/redfish_firmware.py +++ b/plugins/modules/redfish_firmware.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -113,7 +113,7 @@ import json import os from ssl import SSLError -from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish +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.module_utils.urls import ConnectionError, SSLValidationError from ansible.module_utils.six.moves.urllib.error import URLError, HTTPError @@ -186,19 +186,14 @@ def firmware_update(obj, module): def main(): + specs = { + "image_uri": {"required": True, "type": "str"}, + "transfer_protocol": {"type": "str", "default": "HTTP", + "choices": ["CIFS", "FTP", "HTTP", "HTTPS", "NSF", "OEM", "SCP", "SFTP", "TFTP"]}, + } + specs.update(redfish_auth_params) module = AnsibleModule( - argument_spec={ - "baseuri": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "image_uri": {"required": True, "type": "str"}, - "transfer_protocol": {"type": "str", "default": "HTTP", - "choices": ["CIFS", "FTP", "HTTP", "HTTPS", "NSF", "OEM", "SCP", "SFTP", "TFTP"]}, - }, - required_if=[['validate_certs', True, ['ca_path']], ], + argument_spec=specs, supports_check_mode=False) if not HAS_LIB: module.fail_json(msg=missing_required_lib("urllib3")) diff --git a/plugins/modules/redfish_powerstate.py b/plugins/modules/redfish_powerstate.py index a82ea1969..23094b158 100644 --- a/plugins/modules/redfish_powerstate.py +++ b/plugins/modules/redfish_powerstate.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2020-2022 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) @@ -118,7 +118,7 @@ import json import re from ssl import SSLError -from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish +from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params 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 @@ -235,20 +235,16 @@ def run_change_power_state(redfish_session_obj, module): def main(): + specs = { + "resource_id": {"required": False, "type": "str"}, + "reset_type": {"required": True, "type": "str", + "choices": ['ForceOff', 'ForceOn', 'ForceRestart', 'GracefulRestart', + 'GracefulShutdown', 'Nmi', 'On', 'PowerCycle', 'PushPowerButton']}, + } + specs.update(redfish_auth_params) + module = AnsibleModule( - argument_spec={ - "baseuri": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "resource_id": {"required": False, "type": "str"}, - "reset_type": {"required": True, "type": "str", - "choices": ['ForceOff', 'ForceOn', 'ForceRestart', 'GracefulRestart', - 'GracefulShutdown', 'Nmi', 'On', 'PowerCycle', 'PushPowerButton']}, - }, - required_if=[['validate_certs', True, ['ca_path']], ], + argument_spec=specs, supports_check_mode=True) try: with Redfish(module.params) as redfish_obj: diff --git a/plugins/modules/redfish_storage_volume.py b/plugins/modules/redfish_storage_volume.py index 96d73bf8a..740c3cd47 100644 --- a/plugins/modules/redfish_storage_volume.py +++ b/plugins/modules/redfish_storage_volume.py @@ -3,7 +3,7 @@ # # Dell EMC OpenManage Ansible Modules -# Version 5.0.0 +# Version 5.0.1 # Copyright (C) 2019-2022 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) @@ -242,7 +242,7 @@ import json from ssl import SSLError -from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish +from ansible_collections.dellemc.openmanage.plugins.module_utils.redfish import Redfish, redfish_auth_params 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 @@ -514,39 +514,35 @@ def validate_inputs(module): def main(): + specs = { + "state": {"type": "str", "required": False, "choices": ['present', 'absent']}, + "command": {"type": "str", "required": False, "choices": ['initialize']}, + "volume_type": {"type": "str", "required": False, + "choices": ['NonRedundant', 'Mirrored', + 'StripedWithParity', 'SpannedMirrors', + 'SpannedStripesWithParity']}, + "name": {"required": False, "type": "str"}, + "controller_id": {"required": False, "type": "str"}, + "drives": {"elements": "str", "required": False, "type": "list"}, + "block_size_bytes": {"required": False, "type": "int"}, + "capacity_bytes": {"required": False, "type": "str"}, + "optimum_io_size_bytes": {"required": False, "type": "int"}, + "encryption_types": {"type": "str", "required": False, + "choices": ['NativeDriveEncryption', 'ControllerAssisted', 'SoftwareAssisted']}, + "encrypted": {"required": False, "type": "bool"}, + "volume_id": {"required": False, "type": "str"}, + "oem": {"required": False, "type": "dict"}, + "initialize_type": {"type": "str", "required": False, "choices": ['Fast', 'Slow'], "default": "Fast"}, + } + + specs.update(redfish_auth_params) + module = AnsibleModule( - argument_spec={ - "baseuri": {"required": True, "type": "str"}, - "username": {"required": True, "type": "str"}, - "password": {"required": True, "type": "str", "no_log": True}, - "validate_certs": {"type": "bool", "default": True}, - "ca_path": {"type": "path"}, - "timeout": {"type": "int", "default": 30}, - "state": {"type": "str", "required": False, "choices": ['present', 'absent']}, - "command": {"type": "str", "required": False, "choices": ['initialize']}, - "volume_type": {"type": "str", "required": False, - "choices": ['NonRedundant', 'Mirrored', - 'StripedWithParity', 'SpannedMirrors', - 'SpannedStripesWithParity']}, - "name": {"required": False, "type": "str"}, - "controller_id": {"required": False, "type": "str"}, - "drives": {"elements": "str", "required": False, "type": "list"}, - "block_size_bytes": {"required": False, "type": "int"}, - "capacity_bytes": {"required": False, "type": "str"}, - "optimum_io_size_bytes": {"required": False, "type": "int"}, - "encryption_types": {"type": "str", "required": False, - "choices": ['NativeDriveEncryption', 'ControllerAssisted', 'SoftwareAssisted']}, - "encrypted": {"required": False, "type": "bool"}, - "volume_id": {"required": False, "type": "str"}, - "oem": {"required": False, "type": "dict"}, - "initialize_type": {"type": "str", "required": False, "choices": ['Fast', 'Slow'], "default": "Fast"}, - - }, + argument_spec=specs, mutually_exclusive=[['state', 'command']], required_one_of=[['state', 'command']], required_if=[['command', 'initialize', ['volume_id']], - ['state', 'absent', ['volume_id']], - ['validate_certs', True, ['ca_path']], ], + ['state', 'absent', ['volume_id']], ], supports_check_mode=False) try: