Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(idrac_os_deployment): added support for ubuntu installation #784

Open
wants to merge 1 commit into
base: collections
Choose a base branch
from

Conversation

Sakethanne
Copy link

Description

This pull request extends the functionality of the idrac_os_deployment Ansible role to provide native support for Ubuntu Jammy (Ubuntu 22.04 LTS). This includes updates to the OS detection logic, modifications to ensure compatibility with the iDRAC OS deployment process, and test validation for seamless integration.

The enhancements address the gap in supporting newer Ubuntu versions, aligning the role with modern deployment requirements.

GitHub Issues

List the GitHub issues impacted by this PR: #780

GitHub Issue #
Add UBUNTU native support for idrac_os_deployment ansible role

Currently only RHEL and EXSI have native support for the idrac_os_deployment role and it currently does not have native support for the Ubuntu OS. | #780

ISSUE TYPE

  • Feature Pull Request
COMPONENT NAME

Role: idrac_os_deployment

OUTPUT
  • OS deployment tested successfully for Ubuntu Jammy 22.04 using iDRAC. Key results:
    • OS detection worked as expected for the new Ubuntu version.
    • Pre-installation tasks (e.g., image mounting, iDRAC configuration) completed without errors.
    • Post-deployment verification confirmed successful installation of Ubuntu Jammy 22.04.
    • Logs from the iDRAC console validated the integrity and compatibility of the deployment process.
ADDITIONAL INFORMATION

The changes resolve the inability of the idrac_os_deployment role to recognize and process Ubuntu Jammy 22.04.

Key Updates:
Enhanced the OS detection mechanism to include Ubuntu Jammy 22.04.
Adjusted playbook logic to handle the differences in OS setup for Jammy compared to older Ubuntu versions.
Updated documentation to include instructions for deploying Ubuntu 22.04.

Checklist:

  • [ yes] I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • [ yes] I have verified that new and existing unit tests pass locally with my changes
  • [ yes] I have not allowed coverage numbers to degenerate
  • [ yes] I have maintained at least 90% code coverage
  • [ yes] I have commented my code, particularly in hard-to-understand areas
  • [ yes] I have made corresponding changes to the documentation
  • [ yes] I have added tests that prove my fix is effective or that my feature works
  • [ yes] I have maintained backward compatibility

@ansible-collections-svc
Copy link
Collaborator

Can one of the admins verify this patch?

1 similar comment
@ansible-collections-svc
Copy link
Collaborator

Can one of the admins verify this patch?

roles/idrac_os_deployment/tasks/iso/extract_iso.yml Outdated Show resolved Hide resolved
roles/idrac_os_deployment/tasks/iso/extract_iso.yml Outdated Show resolved Hide resolved
@@ -0,0 +1,10 @@
ubuntu_hostname: "ubuntu"
ubuntu_user_password: "$6$xlpCfETR.9nMepDn$0GDk0yuTOOMXrxFQacjQdbTNwCys.wMlo.EDzfKJGvLhy61R8IxaSCNveo247McGthyg7vBUgDlmTS3wF.64k1" # Initial user password (hashed using SHA-512)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Password should not be defaulted instead add a check in the commons/validate_inputs.yml to ensure user has given password as a input to the role for ubuntu
Else once installed they would not know what the password was.

roles/idrac_os_deployment/vars/main.yml Outdated Show resolved Hide resolved
Comment on lines 14 to 17
- uri: "http://archive.ubuntu.com/ubuntu"
arches: [i386, amd64]
- uri: "http://ports.ubuntu.com/ubuntu-ports"
arches: [s390x, arm64, armhf, powerpc, ppc64el, riscv64]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to move these to a vars as well. In a Data center sometimes they would not have access to the internet and want to use there own mirror.

@sachin-apa sachin-apa added type/feature A feature. This label is applied to a feature issues. needs/oss-change validation/pending labels Dec 13, 2024
update: yes
apt:
preserve_sources_list: false
mirror-selection:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have to set this at all? maybe just remove this section and see if it works... ?

@@ -423,7 +423,7 @@ Role Variables
</tr>
<tr>
<td>idrac_os_deployment_supported_os</td>
<td>{ RHEL: ["8", "9"], ESXI: ["8"] }</td>
<td>{ RHEL: ["8", "9"], ESXI: ["8"], UBUNTU: ["jammy"] }</td>
Copy link

@glimchb glimchb Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder naming 22.04 vs jammy - what is better
https://wiki.ubuntu.com/Releases

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since in the versioning format, he has not considered patch, both seems to be ok. Still if we have chanceof having different kickstsrt template based on versions, i would recommend to go with 22.04

@Sakethanne Sakethanne force-pushed the ubuntu_support branch 3 times, most recently from 2e74701 to 39be8ab Compare December 15, 2024 02:09
Signed-off-by: sakethanne <asvn.saketh@gmail.com>
@Sakethanne
Copy link
Author

Have updated the code according to the comments and pushed them!

1. Compile the iso to generate a custom iso by embedding the kickstart file in an iso using the `mkisofs`, `isohybrid` and `implantisomd5` commands.
1. Copy the custom ISO generated to destination share location as specfied to the role input. Based on the input a following method is used to copy the destination to a shared repository.
2. Create a kickstart file using jinja template based on the os name and version .
3. Extract the ISO using the `xorriso` library, in case of ubuntu we use `7z`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it possible to use xorriso library for ubuntu too, as again we shall have new dependency on 7z, can you check and confirm once.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to acheive the same functionality with the xorisso command to unpack the ubuntu 22.04 version iso as compared to the 7z command.

The unpacked files were completely different between xorisso and 7z.

@@ -37,14 +37,14 @@ argument_specs:
type: str
description:
- The operating system name to match the jinja template of the kickstart file.
- Supported os name is versions for RHEL and ESXI.
- Supported os name is versions for RHEL and ESXI and UBUNTU.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Supported os name is versions for RHEL and ESXI and UBUNTU.
- Supported os name is versions for RHEL, ESXI and UBUNTU.

- Jinja template file should exists in the format <os_name_upper>_<os_version_major>.j2
- This is required when I(is_custom_iso) is C(false).
os_version:
type: str
description:
- The operating system version to match the jinja template of the kickstart file.
- Supported versions for RHEL are 9.x and 8.x and for ESXi is 8.x.
- Supported versions for RHEL are 9.x and 8.x and for ESXi is 8.x and for UBUNTU is jammy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Supported versions for RHEL are 9.x and 8.x and for ESXi is 8.x and for UBUNTU is jammy.
- Supported versions for RHEL are 9.x and 8.x, for ESXi is 8.x and for UBUNTU is jammy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/oss-change type/feature A feature. This label is applied to a feature issues. validation/pending
Projects
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add UBUNTU native support for idrac_os_deployment ansible role
5 participants