Skip to content

Commit

Permalink
Merge branch 'collections' into feature/omevv_firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
rajshekarp87 authored Dec 24, 2024
2 parents a0fc9f9 + 75a01ac commit a86891b
Show file tree
Hide file tree
Showing 79 changed files with 2,587 additions and 150 deletions.
46 changes: 43 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,48 @@ Dell OpenManage Ansible Modules Release Notes

.. contents:: Topics

v9.10.0
=======

Release Summary
---------------

- The ``omevv_firmware`` module is added to support the firmware update of the single host and single cluster.
- The ``omevv_firmware_repository_profile`` module is enhanced to support resync of repository profiles from the OpenManage Update Manager Plug-in.
- The ``idrac_certificates`` module is enhanced to support SSL CSR generation for 4096 key size. (Issue #737)

Major Changes
-------------

- omevv_firmware - This module allows to update firmware of the single host and single cluster.

Minor Changes
-------------

- omevv_firmware_repository_profile - This module allows to resync the repository profiles from the OpenManage Update Manager Plug-in.
- idrac_certificates - This module is enhanced to support SSL CSR generation for 4096 key size.

Bugfixes
--------

- idrac_certificates - (Issue 737) - Fixed SSL CSR generation for 4096 key size.

Known Issues
------------

- idrac_diagnostics - Issue(285322) - This module doesn't support export of diagnostics file to HTTP and HTTPS share via SOCKS proxy.
- idrac_firmware - Issue(279282) - This module does not support firmware update using HTTP, HTTPS, and FTP shares with authentication on iDRAC8.
- ome_smart_fabric_uplink - Issue(186024) - The module supported by OpenManage Enterprise Modular, however it does not allow the creation of multiple uplinks of the same name. If an uplink is created using the same name as an existing uplink, then the existing uplink is modified.

v9.9.0
======

Release Summary
---------------

- Modules are added to support OpenManage Enterprise Integration for VMWare vCenter Plug-in. - The ``omevv_baseline_profile_info`` module is added to support retrieval of baseline profile information. - The ``omevv_compliance_info`` module is added to support retrieval of firmware compliance reports. - The ``omevv_baseline_profile`` module is added to support management of baseline profile.
- The ``omevv_baseline_profile_info`` module is added to support retrieval of baseline profile information.
- The ``omevv_compliance_info`` module is added to support retrieval of firmware compliance reports.
- The ``omevv_baseline_profile`` module is added to support management of baseline profile.

Major Changes
-------------
Expand All @@ -32,7 +67,11 @@ v9.8.0
Release Summary
---------------

- Modules are added to support OpenManage Enterprise Integration for VMWare vCenter Plug-in. - The ``omevv_vcenter_info`` module is added to support retrieval of vCenter information. - The ``omevv_firmware_repository_profile_info`` module is added to support retrieval of firmware repository profile information. - The ``omevv_firmware_repository_profile`` module is added to support management of firmware repository profile. - The ``idrac_firmware_info`` module is enhanced to support iDRAC10 and OMSDK dependency is removed.
- Modules are added to support OpenManage Enterprise Integration for VMWare vCenter Plug-in.
- The ``omevv_vcenter_info`` module is added to support retrieval of vCenter information.
- The ``omevv_firmware_repository_profile_info`` module is added to support retrieval of firmware repository profile information.
- The ``omevv_firmware_repository_profile`` module is added to support management of firmware repository profile.
- The ``idrac_firmware_info`` module is enhanced to support iDRAC10 and OMSDK dependency is removed.

Major Changes
-------------
Expand Down Expand Up @@ -66,7 +105,8 @@ v9.7.0
Release Summary
---------------

- The ``idrac_secure_boot`` module is enhanced to export, reset and configure the attributes of boot certificate. - The ``idrac_system_erase`` module is added to add support to erase system and storage components of the server.
- The ``idrac_secure_boot`` module is enhanced to export, reset and configure the attributes of boot certificate.
- The ``idrac_system_erase`` module is added to add support to erase system and storage components of the server.

Major Changes
-------------
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ OpenManage Ansible Modules simplifies and automates provisioning, deployment, an
* Dell OpenManage Enterprise Modular versions 2.10.10 and above.

## Requirements
* [Ansible Core >= 2.18.0 and 2.17.5](https://github.com/ansible/ansible)
* [Ansible Core >= 2.18.1 and 2.17.7](https://github.com/ansible/ansible)
* Python >= 3.9.6
* To run the iDRAC modules, install OpenManage Python Software Development Kit (OMSDK)
using either ```pip install omsdk --upgrade``` or ```pip install -r requirements.txt```.
OMSDK can also be installed from [Dell OpenManage Python SDK](https://github.com/dell/omsdk)
* Operating System
* Red Hat Enterprise Linux (RHEL) 9.4 and 8.10
* Red Hat Enterprise Linux (RHEL) 9.5 and 8.10
* SUSE Linux Enterprise Server (SLES) 15 SP5 and 15 SP4
* Ubuntu 24.04.1 and 24.04

Expand Down
40 changes: 40 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2177,3 +2177,43 @@ releases:
name: omevv_baseline_profile
namespace: ''
release_date: '2024-11-30'

9.10.0:
changes:
release_summary: '- The ``omevv_firmware`` module is added to support
the firmware update of the single host and single cluster.
- The ``omevv_firmware_repository_profile`` module is enhanced to
support resync of repository profiles from the OpenManage Update
Manager Plug-in.
- The ``idrac_certificates`` module is enhanced to support
SSL CSR generation for 4096 key size.'
major_changes:
- omevv_firmware - This module allows to update firmware
of the single host and single cluster.
minor_changes:
- omevv_firmware_repository_profile - This module allows to resync the
repository profiles from the OpenManage Update Manager Plug-in.
- idrac_certificates - This module is enhanced to support
SSL CSR generation for 4096 key size.
bugfixes:
- idrac_certificates - (Issue 737) - Fixed SSL CSR generation for
4096 key size.
known_issues:
- idrac_diagnostics - Issue(285322) - This module doesn't support
export of diagnostics file to HTTP and HTTPS share via SOCKS
proxy.
- idrac_firmware - Issue(279282) - This module does not support
firmware update using HTTP, HTTPS, and FTP shares with
authentication on iDRAC8.
- ome_smart_fabric_uplink - Issue(186024) - The module supported by
OpenManage Enterprise Modular, however it does not allow the
creation of multiple uplinks of the same name. If an uplink is
created using the same name as an existing uplink, then the existing
uplink is modified.
modules:
- description:
This module allows to update firmware of the single host and
single cluster.
name: omevv_firmware
namespace: ''
release_date: '2024-12-31'
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: dellemc
name: openmanage
version: 9.9.0
version: 9.10.0
readme: README.md
authors:
- Jagadeesh N V <[email protected]>
Expand Down
69 changes: 49 additions & 20 deletions plugins/module_utils/omevv_utils/omevv_firmware_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
INVALID_CLUSTER_NAMES_MSG = "Invalid cluster names: {cluster_names}. Please provide valid cluster(s)."
NO_CLUSTERS_FOUND_MSG = "No clusters found."
PROFILE_URI = "/RepositoryProfiles"
RESYNC_UMP_URI = "/RepositoryProfiles/ResyncRepository"
TEST_CONNECTION_URI = "/RepositoryProfiles/TestConnection"
TEST_CONNECTION_HISTORY = "/TestConnectionJobs/{job_id}/ExecutionHistories"
BASELINE_PROFILE_URI = "/Consoles/{vcenter_uuid}/BaselineProfiles"
Expand Down Expand Up @@ -68,7 +69,8 @@ def get_firmware_repository_profile(self, profile_name=None):
if resp.success:
profile_info = resp.json_data
if profile_name:
profile_info = self.search_profile_name(profile_info, profile_name)
profile_info = self.search_profile_name(
profile_info, profile_name)
return profile_info

def get_all_repository_profiles(self):
Expand Down Expand Up @@ -189,12 +191,15 @@ def test_connection(self, protocol_type, catalog_path, share_username, share_pas
protocol_type, catalog_path, share_username, share_password, share_domain)
resp = self.omevv.invoke_request("POST", TEST_CONNECTION_URI, payload)
if resp.success:
time.sleep(5) # Waiting here because response comes as empty at first call
# Waiting here because response comes as empty at first call
time.sleep(5)
job_id = resp.json_data
resp_history = self.omevv.invoke_request("GET", TEST_CONNECTION_HISTORY.format(job_id=job_id))
resp_history = self.omevv.invoke_request(
"GET", TEST_CONNECTION_HISTORY.format(job_id=job_id))
while resp_history.json_data[0]["statusSummary"] != "SUCCESSFUL" and resp_history.json_data[0]["statusSummary"] != "FAILED":
time.sleep(3)
resp_history = self.omevv.invoke_request("GET", TEST_CONNECTION_HISTORY.format(job_id=job_id))
resp_history = self.omevv.invoke_request(
"GET", TEST_CONNECTION_HISTORY.format(job_id=job_id))
if resp_history.json_data[0]["statusSummary"] == "SUCCESSFUL":
return True
else:
Expand Down Expand Up @@ -236,7 +241,8 @@ def create_firmware_repository_profile(self, name, catalog_path,
required_params = [name, catalog_path, protocol_type]
missing_params = [param for param in required_params if param is None]
if missing_params:
err_msg = "Required parameters such as: " + ", ".join(missing_params)
err_msg = "Required parameters such as: " + \
", ".join(missing_params)

payload = self.get_create_payload_details(name, catalog_path,
description, protocol_type,
Expand Down Expand Up @@ -272,7 +278,8 @@ def modify_firmware_repository_profile(self, profile_id, name, catalog_path,
required_params = [name, catalog_path]
missing_params = [param for param in required_params if param is None]
if missing_params:
err_msg = "Required parameters such as: " + ", ".join(missing_params)
err_msg = "Required parameters such as: " + \
", ".join(missing_params)

payload = self.get_modify_payload_details(name, catalog_path,
description,
Expand All @@ -291,6 +298,14 @@ def delete_firmware_repository_profile(self, profile_id):
"DELETE", PROFILE_URI + "/" + str(profile_id))
return resp

def resync_repository_profiles_from_ump(self):
"""
Resyncs the repository profiles from UMP.
"""
resp = self.omevv.invoke_request("POST", RESYNC_UMP_URI, {})
return resp


class OMEVVBaselineProfile:
def __init__(self, omevv):
Expand All @@ -312,7 +327,8 @@ def validate_repository_profile(self, repository_profile):
if not available_repo_profiles:
return False, NO_REPO_PROFILE_MSG

available_repo_profile_names = [profile.get('profileName') for profile in available_repo_profiles.json_data]
available_repo_profile_names = [profile.get(
'profileName') for profile in available_repo_profiles.json_data]

if repository_profile not in available_repo_profile_names:
return False, INVALID_REPO_PROFILE_MSG.format(repository_profile=repository_profile)
Expand Down Expand Up @@ -343,10 +359,12 @@ def validate_cluster_names(self, cluster_names, vcenter_uuid):
available_cluster_names = [
cluster.get('name') for cluster in available_clusters if cluster.get('name') is not None
]
invalid_clusters = [cluster for cluster in cluster_names if cluster not in available_cluster_names]
invalid_clusters = [
cluster for cluster in cluster_names if cluster not in available_cluster_names]

if invalid_clusters:
error_message = INVALID_CLUSTER_NAMES_MSG.format(cluster_names=', '.join(invalid_clusters))
error_message = INVALID_CLUSTER_NAMES_MSG.format(
cluster_names=', '.join(invalid_clusters))
return False, error_message

return True, ""
Expand All @@ -361,7 +379,8 @@ def get_all_clusters(self, vcenter_uuid):
Returns:
list: The list of all cluster information.
"""
clusters_resp = self.omevv.invoke_request('GET', CLUSTER_URI.format(vcenter_uuid=vcenter_uuid))
clusters_resp = self.omevv.invoke_request(
'GET', CLUSTER_URI.format(vcenter_uuid=vcenter_uuid))

# If the response is a list (as per the error), return it directly
if isinstance(clusters_resp, list):
Expand All @@ -384,7 +403,8 @@ def get_cluster_id(self, cluster_names, vcenter_uuid):
clusters = self.get_all_clusters(vcenter_uuid=vcenter_uuid)

# Map cluster name to entity ID (clustId)
cluster_ids = [c['entityId'] for c in clusters if c['name'] in cluster_names]
cluster_ids = [c['entityId']
for c in clusters if c['name'] in cluster_names]

return cluster_ids

Expand All @@ -402,14 +422,17 @@ def get_group_ids_for_clusters(self, vcenter_uuid, cluster_names):
clusters = self.get_all_clusters(vcenter_uuid=vcenter_uuid)

# Map cluster name to entity ID (clustId)
cluster_ids = [c['entityId'] for c in clusters if c['name'] in cluster_names]
cluster_ids = [c['entityId']
for c in clusters if c['name'] in cluster_names]

# Fetch group IDs for the identified cluster IDs
group_ids = []
if cluster_ids:
payload = {"clustIds": cluster_ids}
group_resp = self.omevv.invoke_request('POST', CLUSTER_IDS_URI.format(vcenter_uuid=vcenter_uuid), payload)
group_ids = [g['groupId'] for g in group_resp.json_data] if hasattr(group_resp, 'json_data') and group_resp.success else []
group_resp = self.omevv.invoke_request(
'POST', CLUSTER_IDS_URI.format(vcenter_uuid=vcenter_uuid), payload)
group_ids = [g['groupId'] for g in group_resp.json_data] if hasattr(
group_resp, 'json_data') and group_resp.success else []

return group_ids

Expand All @@ -436,7 +459,8 @@ def get_baseline_profiles(self, vcenter_uuid):
Raises:
None
"""
response = self.omevv.invoke_request('GET', BASELINE_PROFILE_URI.format(vcenter_uuid=vcenter_uuid))
response = self.omevv.invoke_request(
'GET', BASELINE_PROFILE_URI.format(vcenter_uuid=vcenter_uuid))
if response.success:
return response.json_data

Expand Down Expand Up @@ -520,13 +544,15 @@ def get_current_job_schedule(self, profile_id, vcenter_uuid):
dict: Job schedule details if available.
"""
resp = self.omevv.invoke_request(
"GET", DRIFT_URI.format(vcenter_uuid=vcenter_uuid) + "/" + str(profile_id)
"GET", DRIFT_URI.format(
vcenter_uuid=vcenter_uuid) + "/" + str(profile_id)
)
return resp.json_data

def get_add_remove_group_ids(self, existing_profile, vcenter_uuid, cluster_names):
"""Determine groups to add or remove based on the cluster names"""
current_group_ids = {group['omevv_groupID'] for group in existing_profile.get('clusterGroups', [])}
current_group_ids = {group['omevv_groupID']
for group in existing_profile.get('clusterGroups', [])}

new_group_ids = set(self.get_group_ids_for_clusters(
vcenter_uuid=vcenter_uuid,
Expand Down Expand Up @@ -563,7 +589,8 @@ def create_baseline_profile(self, name, firmware_repo_id, group_ids, job_schedul
["name", "firmware_repo_id", "group_ids", "job_schedule"], required_params) if param is None]

if missing_params:
err_msg = "Required parameters missing: " + ", ".join(missing_params)
err_msg = "Required parameters missing: " + \
", ".join(missing_params)
return None, err_msg

payload = {
Expand All @@ -575,7 +602,8 @@ def create_baseline_profile(self, name, firmware_repo_id, group_ids, job_schedul
if description is not None:
payload["description"] = description

resp = self.omevv.invoke_request("POST", BASELINE_PROFILE_URI.format(vcenter_uuid=vcenter_uuid), payload)
resp = self.omevv.invoke_request(
"POST", BASELINE_PROFILE_URI.format(vcenter_uuid=vcenter_uuid), payload)
return resp, err_msg

def modify_baseline_profile(self, add_group_ids, remove_group_ids, profile_id, vcenter_uuid, firmware_repo_id=None, job_schedule=None, description=None):
Expand Down Expand Up @@ -615,7 +643,8 @@ def modify_baseline_profile(self, add_group_ids, remove_group_ids, profile_id, v
payload["description"] = description

# Construct the URL for the PATCH request
url = BASELINE_PROFILE_URI.format(vcenter_uuid=vcenter_uuid) + f"/{profile_id}"
url = BASELINE_PROFILE_URI.format(
vcenter_uuid=vcenter_uuid) + f"/{profile_id}"

# Send the PATCH request using the appropriate method (e.g., self.omevv.invoke_request)
resp = self.omevv.invoke_request("PATCH", url, payload)
Expand Down
Loading

0 comments on commit a86891b

Please sign in to comment.