Skip to content

Commit

Permalink
Merge pull request #1476 from 0nebody/rhel_9_ova
Browse files Browse the repository at this point in the history
RHEL9 OVA
  • Loading branch information
k8s-ci-robot authored May 27, 2024
2 parents 9523367 + 6ebeed5 commit 902a2a4
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 2 deletions.
11 changes: 10 additions & 1 deletion images/capi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ PACKER_POWERVS_NODE_FLAGS := $(foreach f,$(abspath $(COMMON_POWERVS_VAR_FILES)),
CENTOS_VERSIONS := centos-7
FLATCAR_VERSIONS := flatcar
PHOTON_VERSIONS := photon-3 photon-4 photon-5
RHEL_VERSIONS := rhel-7 rhel-8
RHEL_VERSIONS := rhel-7 rhel-8 rhel-9
ROCKYLINUX_VERSIONS := rockylinux-8 rockylinux-9
UBUNTU_VERSIONS := ubuntu-2004 ubuntu-2004-efi ubuntu-2204 ubuntu-2204-efi
WINDOWS_VERSIONS := windows-2019 windows-2019-efi windows-2022 windows-2022-efi
Expand Down Expand Up @@ -686,6 +686,7 @@ build-node-ova-local-photon-4: ## Builds Photon 4 Node OVA w local hypervisor
build-node-ova-local-photon-5: ## Builds Photon 5 Node OVA w local hypervisor
build-node-ova-local-rhel-7: ## Builds RHEL 7 Node OVA w local hypervisor
build-node-ova-local-rhel-8: ## Builds RHEL 8 Node OVA w local hypervisor
build-node-ova-local-rhel-9: ## Builds RHEL 9 Node OVA w local hypervisor
build-node-ova-local-rockylinux-8: ## Builds RockyLinux 8 Node OVA w local hypervisor
build-node-ova-local-rockylinux-9: ## Builds RockyLinux 9 Node OVA w local hypervisor
build-node-ova-local-ubuntu-2004: ## Builds Ubuntu 20.04 Node OVA w local hypervisor
Expand All @@ -699,6 +700,7 @@ build-node-ova-vsphere-photon-4: ## Builds Photon 4 Node OVA and template on vSp
build-node-ova-vsphere-photon-5: ## Builds Photon 5 Node OVA and template on vSphere
build-node-ova-vsphere-rhel-7: ## Builds RHEL 7 Node OVA and template on vSphere
build-node-ova-vsphere-rhel-8: ## Builds RHEL 8 Node OVA and template on vSphere
build-node-ova-vsphere-rhel-9: ## Builds RHEL 9 Node OVA and template on vSphere
build-node-ova-vsphere-rockylinux-8: ## Builds RockyLinux 8 Node OVA and template on vSphere
build-node-ova-vsphere-rockylinux-9: ## Builds RockyLinux 9 Node OVA and template on vSphere
build-node-ova-vsphere-ubuntu-2004: ## Builds Ubuntu 20.04 Node OVA and template on vSphere
Expand All @@ -717,6 +719,7 @@ build-node-ova-vsphere-clone-photon-4: ## Builds Photon 4 Node OVA and template
build-node-ova-vsphere-clone-photon-5: ## Builds Photon 5 Node OVA and template on vSphere
build-node-ova-vsphere-clone-rhel-7: ## Builds RHEL 7 Node OVA and template on vSphere
build-node-ova-vsphere-clone-rhel-8: ## Builds RHEL 8 Node OVA and template on vSphere
build-node-ova-vsphere-clone-rhel-9: ## Builds RHEL 9 Node OVA and template on vSphere
build-node-ova-vsphere-clone-rockylinux-8: ## Builds RockyLinux 8 Node OVA and template on vSphere
build-node-ova-vsphere-clone-rockylinux-9: ## Builds RockyLinux 9 Node OVA and template on vSphere
build-node-ova-vsphere-clone-ubuntu-2004: ## Builds Ubuntu 20.04 Node OVA and template on vSphere
Expand All @@ -730,6 +733,7 @@ build-node-ova-vsphere-base-photon-4: ## Builds base Photon 4 Node OVA and templ
build-node-ova-vsphere-base-photon-5: ## Builds base Photon 5 Node OVA and template on vSphere
build-node-ova-vsphere-base-rhel-7: ## Builds base RHEL 7 Node OVA and template on vSphere
build-node-ova-vsphere-base-rhel-8: ## Builds base RHEL 8 Node OVA and template on vSphere
build-node-ova-vsphere-base-rhel-9: ## Builds base RHEL 9 Node OVA and template on vSphere
build-node-ova-vsphere-base-rockylinux-8: ## Builds base RockyLinux 8 Node OVA and template on vSphere
build-node-ova-vsphere-base-rockylinux-9: ## Builds base RockyLinux 9 Node OVA and template on vSphere
build-node-ova-vsphere-base-ubuntu-2004: ## Builds base Ubuntu 20.04 Node OVA and template on vSphere
Expand All @@ -743,6 +747,7 @@ build-node-ova-local-vmx-photon-5: ## Builds Photon 5 Node OVA from VMX file w l
build-node-ova-local-vmx-centos-7: ## Builds Centos 7 Node OVA from VMX file w local hypervisor
build-node-ova-local-vmx-rhel-7: ## Builds RHEL 7 Node OVA from VMX file w local hypervisor
build-node-ova-local-vmx-rhel-8: ## Builds RHEL 8 Node OVA from VMX file w local hypervisor
build-node-ova-local-vmx-rhel-9: ## Builds RHEL 9 Node OVA from VMX file w local hypervisor
build-node-ova-local-vmx-rockylinux-8: ## Builds RockyLinux 8 Node OVA from VMX file w local hypervisor
build-node-ova-local-vmx-rockylinux-9: ## Builds RockyLinux 9 Node OVA from VMX file w local hypervisor
build-node-ova-local-vmx-ubuntu-2004: ## Builds Ubuntu 20.04 Node OVA from VMX file w local hypervisor
Expand All @@ -753,6 +758,7 @@ build-node-ova-local-base-photon-5: ## Builds Photon 5 Base Node OVA w local hyp
build-node-ova-local-base-centos-7: ## Builds Centos 7 Base Node OVA w local hypervisor
build-node-ova-local-base-rhel-7: ## Builds RHEL 7 Base Node OVA w local hypervisor
build-node-ova-local-base-rhel-8: ## Builds RHEL 8 Base Node OVA w local hypervisor
build-node-ova-local-base-rhel-9: ## Builds RHEL 9 Base Node OVA w local hypervisor
build-node-ova-local-base-rockylinux-8: ## Builds RockyLinux 8 Base Node OVA w local hypervisor
build-node-ova-local-base-rockylinux-9: ## Builds RockyLinux 9 Base Node OVA w local hypervisor
build-node-ova-local-base-ubuntu-2004: ## Builds Ubuntu 20.04 Base Node OVA w local hypervisor
Expand Down Expand Up @@ -892,6 +898,7 @@ validate-node-ova-local-photon-4: ## Validates Photon 4 Node OVA Packer config w
validate-node-ova-local-photon-5: ## Validates Photon 5 Node OVA Packer config w local hypervisor
validate-node-ova-local-rhel-7: ## Validates RHEL 7 Node OVA Packer config w local hypervisor
validate-node-ova-local-rhel-8: ## Validates RHEL 8 Node OVA Packer config w local hypervisor
validate-node-ova-local-rhel-9: ## Validates RHEL 9 Node OVA Packer config w local hypervisor
validate-node-ova-local-rockylinux-8: ## Validates RockyLinux 8 Node OVA Packer config w local hypervisor
validate-node-ova-local-rockylinux-9: ## Validates RockyLinux 9 Node OVA Packer config w local hypervisor
validate-node-ova-local-ubuntu-2004: ## Validates Ubuntu 20.04 Node OVA Packer config w local hypervisor
Expand All @@ -906,6 +913,7 @@ validate-node-ova-local-vmx-photon-5: ## Validates Photon 5 Node OVA from VMX fi
validate-node-ova-local-vmx-centos-7: ## Validates Centos 7 Node OVA from VMX file w local hypervisor
validate-node-ova-local-vmx-rhel-7: ## Validates RHEL 7 Node OVA from VMX file w local hypervisor
validate-node-ova-local-vmx-rhel-8: ## Validates RHEL 8 Node OVA from VMX file w local hypervisor
validate-node-ova-local-vmx-rhel-9: ## Validates RHEL 9 Node OVA from VMX file w local hypervisor
validate-node-ova-local-vmx-rockylinux-8: ## Validates RockyLinux 8 Node OVA from VMX file w local hypervisor
validate-node-ova-local-vmx-rockylinux-9: ## Validates RockyLinux 9 Node OVA from VMX file w local hypervisor
validate-node-ova-local-vmx-ubuntu-2004: ## Validates Ubuntu 20.04 Node OVA from VMX file w local hypervisor
Expand All @@ -917,6 +925,7 @@ validate-node-ova-local-base-photon-5: ## Validates Photon 5 Base Node OVA w loc
validate-node-ova-local-base-centos-7: ## Validates Centos 7 Base Node OVA w local hypervisor
validate-node-ova-local-base-rhel-7: ## Validates RHEL 7 Base Node OVA w local hypervisor
validate-node-ova-local-base-rhel-8: ## Validates RHEL 8 Base Node OVA w local hypervisor
validate-node-ova-local-base-rhel-9: ## Validates RHEL 9 Base Node OVA w local hypervisor
validate-node-ova-local-base-rockylinux-8: ## Validates RockyLinux 8 Base Node OVA w local hypervisor
validate-node-ova-local-base-rockylinux-9: ## Validates RockyLinux 9 Base Node OVA w local hypervisor
validate-node-ova-local-base-ubuntu-2004: ## Validates Ubuntu 20.04 Base Node OVA w local hypervisor
Expand Down
6 changes: 5 additions & 1 deletion images/capi/packer/goss/goss-vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,19 @@ rhel:
<<: *rh8_rpms
ova:
package:
python2-pip:
open-vm-tools:
os_version:
- distro_version: "7"
package:
python2-pip:
<<: *rh7_rpms
- distro_version: "8"
package:
python2-pip:
<<: *rh8_rpms
- distro_version: "9"
package:
<<: *rh9_rpms
qemu:
package:
open-vm-tools:
Expand Down
82 changes: 82 additions & 0 deletions images/capi/packer/ova/linux/rhel/http/9/ks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# version=RHEL9
# Use CDROM installation media
cdrom

# Use text install
text

# Don't run the Setup Agent on first boot
firstboot --disabled
eula --agreed

# Keyboard layout
keyboard --vckeymap=us --xlayouts='us'

# System language
lang en_US.UTF-8

# Network information
network --bootproto=dhcp --onboot=on --ipv6=auto --activate --hostname=rhel9

# Lock Root account
rootpw --lock

# Create builder user
user --name=builder --groups=wheel --password=builder --plaintext --shell=/bin/bash

# System services
selinux --permissive
firewall --disabled
services --enabled=sshd

# System timezone
timezone UTC

# System booloader configuration
bootloader --location=mbr --boot-drive=sda
zerombr
clearpart --all --initlabel --drives=sda
autopart --nohome --noswap --nolvm

skipx

%packages --ignoremissing --excludedocs
# dnf group info minimal-environment
@^minimal-environment
@core
openssh-server
sed
sudo
python3
open-vm-tools

# Exclude unnecessary firmwares
-iwl*firmware
%end

%addon com_redhat_kdump --disable
%end

reboot

%post

echo 'builder ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/builder
chmod 440 /etc/sudoers.d/builder

# Disable quiet boot and splash screen
sed -i 's/ rhgb quiet//' /etc/default/grub
sed -i 's/ rhgb quiet//' /boot/grub2/grubenv

# Remove the package cache
yum -y clean all

# Disable swap
swapoff -a
rm -f /swapfile
sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab

# Ensure on next boot that network devices get assigned unique IDs.
sed -i '/^\(HWADDR\|UUID\)=/d' /etc/sysconfig/network-scripts/ifcfg-*

%end
20 changes: 20 additions & 0 deletions images/capi/packer/ova/rhel-9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"boot_command_prefix": "<up>e <down><down><end><wait> text inst.ks=",
"boot_command_suffix": "/9/ks.cfg<enter><wait><leftCtrlOn>x<leftCtrlOff>",
"boot_media_path": "http://{{ .HTTPIP }}:{{ .HTTPPort }}",
"build_name": "rhel-9",
"distro_arch": "amd64",
"distro_name": "rhel",
"distro_version": "9",
"epel_rpm_gpg_key": "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9",
"firmware": "efi",
"guest_os_type": "rhel9-64",
"http_directory": "./packer/ova/linux/{{user `distro_name`}}/http/",
"iso_checksum": "398561d7b66f1a4bf23664f4aa8f2cfbb3641aa2f01a320068e86bd1fc0e9076",
"iso_checksum_type": "sha256",
"iso_url": "file:///rhel-9.4-x86_64-dvd.iso",
"os_display_name": "RHEL 9",
"redhat_epel_rpm": "https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm",
"shutdown_command": "shutdown -P now",
"vsphere_guest_os_type": "rhel9_64Guest"
}

0 comments on commit 902a2a4

Please sign in to comment.