diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f137687..5e55dfc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu", "rocky", "centos", "rhel", "flatcar"] + os: ["ubuntu", "rocky", "centos", "rhel", "oraclelinux", "flatcar"] steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 20e71bf..87e9eca 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu", "rocky", "centos", "rhel", "flatcar"] + os: ["ubuntu", "rocky", "centos", "rhel", "oraclelinux", "flatcar"] steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/Makefile b/Makefile index 30a2773..53fc2cd 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,6 @@ ubuntu-ovf-20: manifests/ovf/d2iq-base-Ubuntu-20.04$(NAME_POSTFIX).ovf ubuntu-ovf-22: manifests/ovf/d2iq-base-Ubuntu-22.04$(NAME_POSTFIX).ovf ubuntu-ovf: ubuntu-ovf-20 ubuntu-ovf-22 - rocky: manifests/d2iq-base-RockyLinux-8.7$(NAME_POSTFIX).json manifests/d2iq-base-RockyLinux-9.1$(NAME_POSTFIX).json rocky-test-87: manifests/tests/d2iq-base-RockyLinux-8.7$(NAME_POSTFIX).json.clean rocky-test-87-clean: rocky-test-87 manifests/d2iq-base-RockyLinux-8.7$(NAME_POSTFIX).json.clean @@ -96,6 +95,15 @@ rhel-ovf-86: manifests/ovf/d2iq-base-RHEL-86$(NAME_POSTFIX).ovf rhel-ovf-88: manifests/ovf/d2iq-base-RHEL-88$(NAME_POSTFIX).ovf rhel-ovf: rhel-ovf-79 rhel-ovf-84 rhel-ovf-86 rhel-ovf-88 +oraclelinux: manifests/d2iq-base-OracleLinux-94$(NAME_POSTFIX).json +oraclelinux-test-94: manifests/tests/d2iq-base-OracleLinux-94$(NAME_POSTFIX).json.clean +oraclelinux-test-94-clean: oraclelinux-test-94 manifests/d2iq-base-OracleLinux-94$(NAME_POSTFIX).json.clean +oraclelinux-test: oraclelinux-test-94-clean +oraclelinux-release-94: oraclelinux-test-94 release/d2iq-base-OracleLinux-94$(NAME_POSTFIX) +oraclelinux-release: oraclelinux-release-94 +oraclelinux-ovf-94: manifests/ovf/d2iq-base-OracleLinux-94$(NAME_POSTFIX).ovf +oraclelinux-ovf: oraclelinux-ovf-94 + flatcar: manifests/d2iq-base-Flatcar-3033.3.16$(NAME_POSTFIX).json flatcar-test-3033: manifests/tests/d2iq-base-Flatcar-3033.3.16$(NAME_POSTFIX).json flatcar-test-3033-clean: flatcar-test-3033 manifests/d2iq-base-Flatcar-3033.3.16$(NAME_POSTFIX).json.clean @@ -106,5 +114,5 @@ flatcar-ovf-3033: manifests/ovf/d2iq-base-Flatcar-3033.3.16$(NAME_POSTFIX).ovf flatcar-ovf: flatcar-ovf-3033 -test-all: ubuntu-test rocky-test centos-test rhel-test -release: ubuntu-release rocky-release centos-release rhel-release +test-all: ubuntu-test rocky-test centos-test rhel-test ol-test +release: ubuntu-release rocky-release centos-release rhel-release ol-release diff --git a/README.md b/README.md index 25b39b9..5b77fab 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ There are distribution based make targets for building images - `make ubuntu` - Ubuntu 20.04 and 22.04 - `make rocky` - Ubuntu 8 and 9 - `make centos` - Centos 7.9 +- `make oraclelinux` - OracleLinux 9.10 - `make flatcar` - Flatcar LTS - `make rhel` - RHEL 7.9, 8.4, 8.6 and 8.8 diff --git a/bootfiles/oraclelinux/oraclelinux9.ks b/bootfiles/oraclelinux/oraclelinux9.ks new file mode 100644 index 0000000..d4c2e83 --- /dev/null +++ b/bootfiles/oraclelinux/oraclelinux9.ks @@ -0,0 +1,87 @@ +cdrom +# Use text mode install +text + +# License agreement +eula --agreed + +# System language +lang en_US.UTF-8 + +# Keyboard layout +keyboard --vckeymap=us --xlayouts='us' + + + + + +# Network information +network --bootproto=dhcp --device=link --activate + +### Lock the root account +rootpw --lock + +firewall --disabled + +# SELinux configuration +selinux --permissive + +# Do not configure the X Window System +skipx + +# System timezone +timezone UTC + +# Add a user named builder +user --name=${ssh_username} +sshkey --username=${ssh_username} "${public_key}" + +# System bootloader configuration +bootloader --location=mbr + +# Clear the Master Boot Record +zerombr + +clearpart --all --initlabel +part / --fstype="ext4" --grow --asprimary --label=slash --ondisk=sda + +%packages --excludedocs +# dnf group info minimal-environment +@^minimal-environment +@core +openssh-server +sed +sudo +python3 +open-vm-tools + +# Exclude unnecessary firmwares +-iwl*firmware +%end + +# Enable/disable the following services +services --enabled=sshd + +%post --logfile=/mnt/sysimage/root/ks-post.log --erroronfail +# Disable quiet boot and splash screen +sed --follow-symlinks -i "s/ rhgb quiet//" /etc/default/grub +sed --follow-symlinks -i "s/ rhgb quiet//" /boot/grub2/grubenv +# Passwordless sudo for the user '${ssh_username}' +echo "${ssh_username} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/${ssh_username} +chmod 440 /etc/sudoers.d/${ssh_username} + +# Remove the package cache +dnf makecache +dnf install epel-release -y +dnf makecache +dnf install -y sudo open-vm-tools perl cloud-init cloud-utils-growpart + +# Disable swap +swapoff -a +rm -f /swapfile +sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab +sed -i '/^\(HWADDR\|UUID\)=/d' /etc/sysconfig/network-scripts/ifcfg-* || true +%end + +# Reboot after successful installation +reboot diff --git a/images/base-OracleLinux-94.pkrvar.hcl b/images/base-OracleLinux-94.pkrvar.hcl new file mode 100644 index 0000000..840558e --- /dev/null +++ b/images/base-OracleLinux-94.pkrvar.hcl @@ -0,0 +1,4 @@ +distribution="OracleLinux" +distribution_version="9.4" +iso_url="https://yum.oracle.com/ISOS/OracleLinux/OL9/u4/x86_64/OracleLinux-R9-U4-x86_64-dvd.iso" +iso_checksum="77034a4945474cb7c77820bd299cac9a557b8a298a5810c31d63ce404ad13c5e" diff --git a/vsphere.pkr.hcl b/vsphere.pkr.hcl index 4a2de10..54351a6 100644 --- a/vsphere.pkr.hcl +++ b/vsphere.pkr.hcl @@ -210,6 +210,7 @@ locals { "RockyLinux-8.7" = "${path.root}/bootfiles/rocky/rocky-vault.ks" "RockyLinux-9.1" = "${path.root}/bootfiles/rocky/rocky-vault.ks" "CentOS" = "${path.root}/bootfiles/centos/centos7.ks" + "OracleLinux" = "${path.root}/bootfiles/oraclelinux/oraclelinux9.ks" "Ubuntu" = "${path.root}/bootfiles/ubuntu/autoinstall.yaml" "Ubuntu-18.04" = "${path.root}/bootfiles/ubuntu/preseed.cfg" "Flatcar" = "${path.root}/bootfiles/flatcar/bootfile.sh.tmpl" @@ -275,6 +276,7 @@ locals { "RHEL" = local.el_bootcommand "CentOS" = local.el_old_bootcommand "RockyLinux" = local.el_bootcommand + "OracleLinux" = local.el_bootcommand "Ubuntu-18.04" = local.ubuntu_bionic_bootcommand "Ubuntu-20.04" = local.ubuntu_bootcommand "Ubuntu-22.04" = local.ubuntu_jammy_bootcommand @@ -302,20 +304,22 @@ locals { default_vsphere_guest_os_type = "otherlinux64guest" distro_vsphere_guest_os_type_lookup = { - "Ubuntu" = "ubuntu64Guest", - "CentOS" = "centos64Guest", - "RHEL" = "rhel7_64Guest" - "RockyLinux" = "centos64Guest" - "Flatcar" = "otherlinux64Guest" + "Ubuntu" = "ubuntu64Guest", + "CentOS" = "centos64Guest", + "RHEL" = "rhel7_64Guest" + "RockyLinux" = "centos64Guest" + "OracleLinux" = "oracleLinux64Guest" + "Flatcar" = "otherlinux64Guest" } # lookup by - fallback to distro_default_ssh_username = { - "Ubuntu" = "ubuntu", - "CentOS" = "centos", - "RHEL" = "eluser" - "RockyLinux" = "rockstar" - "Flatcar" = "core" + "Ubuntu" = "ubuntu", + "CentOS" = "centos", + "RHEL" = "eluser" + "RockyLinux" = "rockstar" + "OracleLinux" = "opc" + "Flatcar" = "core" } boot_command_distro = lookup(local.distro_boot_command_lookup, "${var.distribution}", [""]) @@ -434,6 +438,10 @@ locals { "${path.root}/scripts/el/install_open_vm_tools.sh", "${path.root}/scripts/el/cleanup_dnf.sh" ], + "OracleLinux" = [ + "${path.root}/scripts/el/install_open_vm_tools.sh", + "${path.root}/scripts/el/cleanup_dnf.sh" + ], "Flatcar" = [ "${path.root}/scripts/flatcar/no_autologin.sh", "${path.root}/scripts/flatcar/clean.sh",