From 9c4a1176205f23c73fbec906215d439b7788e3c7 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Sun, 6 Jul 2025 18:52:23 -0400 Subject: [PATCH] Added build files for Rocky and Almalinux 10; updated Rocky and Almalinux 9 to 9.6 --- Almalinux/almalinux-10.pkr.hcl | 72 +++++++++++++++++++ Almalinux/almalinux-9.pkr.hcl | 8 +-- Rocky/rocky-10.pkr.hcl | 72 +++++++++++++++++++ Rocky/rocky-9.pkr.hcl | 8 +-- ...alinux-9-server.ks => almalinux-server.ks} | 16 ++--- http/{rocky-9-server.ks => rocky-server.ks} | 12 ++-- 6 files changed, 166 insertions(+), 22 deletions(-) create mode 100644 Almalinux/almalinux-10.pkr.hcl create mode 100644 Rocky/rocky-10.pkr.hcl rename http/{almalinux-9-server.ks => almalinux-server.ks} (84%) rename http/{rocky-9-server.ks => rocky-server.ks} (88%) diff --git a/Almalinux/almalinux-10.pkr.hcl b/Almalinux/almalinux-10.pkr.hcl new file mode 100644 index 0000000..b5390bd --- /dev/null +++ b/Almalinux/almalinux-10.pkr.hcl @@ -0,0 +1,72 @@ +variable "proxmox_apiuser" { + type = string + default = "packer" +} + +variable "proxmox_apitoken" { + type = string + default = "changeme" +} + +source "proxmox-iso" "almalinux-10" { + template_name = "almalinux-10" + template_description = "Almalinux 10.0, generated on ${timestamp()}" + vm_id = "207" + boot_wait = "10s" + boot_key_interval = "200ms" + boot_command = ["e", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux-server.ks", "", "x", ""] + + http_directory = "http" + http_port_max = "8089" + http_port_min = "8080" + + os = "l26" + cores = "2" + sockets = "1" + cpu_type = "host" + memory = "2048" + scsi_controller = "virtio-scsi-single" + disks { + disk_size = "30G" + storage_pool = "templates" + type = "scsi" + format = "qcow2" + } + network_adapters { + bridge = "vmbr0" + model = "virtio" + } + + proxmox_url = "https://kamino.int.metaunix.net:8006/api2/json/" + insecure_skip_tls_verify = true + username = "${var.proxmox_apiuser}" + password = "${var.proxmox_apitoken}" + node = "kamino" + pool = "Templates" + + boot_iso { + type = "scsi" + iso_url = "https://repo.almalinux.org/almalinux/10/isos/x86_64/AlmaLinux-10.0-x86_64-boot.iso" + iso_checksum = "sha256:a1549729bfb66a28e3546c953033c9928eae7280917bb1c490983dba3bb9941c" + iso_download_pve = true + iso_storage_pool = "iso" + unmount = true + } + + ssh_username = "xadmin" + ssh_password = "packer" + ssh_timeout = "20m" +} + +build { + sources = ["source.proxmox-iso.almalinux-10"] + + provisioner "shell" { + script = "scripts/rhel-install.sh" + } + + provisioner "file" { + source = "scripts/initial-setup.sh" + destination = "/home/xadmin/initial-setup.sh" + } +} diff --git a/Almalinux/almalinux-9.pkr.hcl b/Almalinux/almalinux-9.pkr.hcl index ada3df4..4a1d010 100644 --- a/Almalinux/almalinux-9.pkr.hcl +++ b/Almalinux/almalinux-9.pkr.hcl @@ -10,11 +10,11 @@ variable "proxmox_apitoken" { source "proxmox-iso" "almalinux-9" { template_name = "almalinux-9" - template_description = "Almalinux 9.5, generated on ${timestamp()}" + template_description = "Almalinux 9.6, generated on ${timestamp()}" vm_id = "204" boot_wait = "10s" boot_key_interval = "200ms" - boot_command = ["", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux-9-server.ks"] + boot_command = ["", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux-server.ks", "", ""] http_directory = "http" http_port_max = "8089" @@ -46,8 +46,8 @@ source "proxmox-iso" "almalinux-9" { boot_iso { type = "scsi" - iso_url = "https://repo.almalinux.org/almalinux/9.5/isos/x86_64/AlmaLinux-9.5-x86_64-boot.iso" - iso_checksum = "sha256:3038fb71a29d33c3c93117bd8f4c3f612cb152dce057c666b6b11dfa793fb65c" + iso_url = "https://repo.almalinux.org/almalinux/9.6/isos/x86_64/AlmaLinux-9.6-x86_64-boot.iso" + iso_checksum = "sha256:113521ec7f28aa4ab71ba4e5896719da69a0cc46cf341c4ebbd215877214f661" iso_download_pve = true iso_storage_pool = "iso" unmount = true diff --git a/Rocky/rocky-10.pkr.hcl b/Rocky/rocky-10.pkr.hcl new file mode 100644 index 0000000..610ab90 --- /dev/null +++ b/Rocky/rocky-10.pkr.hcl @@ -0,0 +1,72 @@ +variable "proxmox_apiuser" { + type = string + default = "packer" +} + +variable "proxmox_apitoken" { + type = string + default = "changeme" +} + +source "proxmox-iso" "rocky-10" { + template_name = "rocky-10" + template_description = "Rocky Linux 10.0, generated on ${timestamp()}" + vm_id = "208" + boot_wait = "10s" + boot_key_interval = "200ms" + boot_command = ["e", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky-server.ks", "", "x", ""] + + http_directory = "http" + http_port_max = "8089" + http_port_min = "8080" + + os = "l26" + cores = "2" + sockets = "1" + cpu_type = "host" + memory = "2048" + scsi_controller = "virtio-scsi-single" + disks { + disk_size = "30G" + storage_pool = "templates" + type = "scsi" + format = "qcow2" + } + network_adapters { + bridge = "vmbr0" + model = "virtio" + } + + proxmox_url = "https://kamino.int.metaunix.net:8006/api2/json/" + insecure_skip_tls_verify = true + username = "${var.proxmox_apiuser}" + password = "${var.proxmox_apitoken}" + node = "kamino" + pool = "Templates" + + boot_iso { + type = "scsi" + iso_url = "https://download.rockylinux.org/pub/rocky/10/isos/x86_64/Rocky-10.0-x86_64-boot.iso" + iso_checksum = "sha256:2bb073606d8d83cbd3c0e25c5e6cd8e5c60c0e989e6e84f0c415c05e163640d3" + iso_download_pve = true + iso_storage_pool = "iso" + unmount = true + } + + ssh_username = "xadmin" + ssh_password = "packer" + ssh_timeout = "20m" +} + +build { + sources = ["source.proxmox-iso.rocky-10"] + + provisioner "shell" { + script = "scripts/rhel-install.sh" + } + + provisioner "file" { + source = "scripts/initial-setup.sh" + destination = "/home/xadmin/initial-setup.sh" + } +} diff --git a/Rocky/rocky-9.pkr.hcl b/Rocky/rocky-9.pkr.hcl index 1196bc1..bc75c26 100644 --- a/Rocky/rocky-9.pkr.hcl +++ b/Rocky/rocky-9.pkr.hcl @@ -10,11 +10,11 @@ variable "proxmox_apitoken" { source "proxmox-iso" "rocky-9" { template_name = "rocky-9" - template_description = "Rocky Linux 9.5, generated on ${timestamp()}" + template_description = "Rocky Linux 9.6, generated on ${timestamp()}" vm_id = "201" boot_wait = "10s" boot_key_interval = "200ms" - boot_command = ["", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky-9-server.ks"] + boot_command = ["", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky-server.ks", "", ""] http_directory = "http" http_port_max = "8089" @@ -46,8 +46,8 @@ source "proxmox-iso" "rocky-9" { boot_iso { type = "scsi" - iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.5-x86_64-boot.iso" - iso_checksum = "sha256:628c069c9685477360640a6b58dc919692a11c44b49a50a024b5627ce3c27d5f" + iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.6-x86_64-boot.iso" + iso_checksum = "sha256:0fad8d8b19a94a0222ea37152cdf5601229fe0178b651dc476e1cba41d2e6067" iso_download_pve = true iso_storage_pool = "iso" unmount = true diff --git a/http/almalinux-9-server.ks b/http/almalinux-server.ks similarity index 84% rename from http/almalinux-9-server.ks rename to http/almalinux-server.ks index 4ee0b9d..fa11dce 100644 --- a/http/almalinux-9-server.ks +++ b/http/almalinux-server.ks @@ -6,14 +6,13 @@ keyboard --vckeymap=us --xlayouts='us' lang en_US.UTF-8 # System timezone -timezone America/New_York --isUtc +timezone America/New_York # Crypted root password rootpw --iscrypted $6$kkuIkd8S9gDUhK8g$1XbqJDCjt1zQAhxb9sC2mE5CGd.D0xV1efu0R8h1e.oovRKtEWqR5KaTDPSTztpxSw2qmDVORZJGnNpiJxUFT1 -# MD5 password hashing +# SHA512 password hashing authselect --useshadow --passalgo=sha512 # Create my initial user :D -#user --disabled user --name=xadmin --shell=/bin/bash --homedir=/home/xadmin --iscrypted --password=$6$8DdxHyrH6HfGZhDs$jEadYAMi3CTJivYgGjhG7S2C/ChZxv0w0L6AQ3Egn8K5xIA4OEqDngVfozfn.9kYxy.hWYpzwBE0qwytcU4BF0 network --device=eth0 --bootproto=dhcp --ipv6=auto --activate @@ -24,14 +23,15 @@ firstboot --disable selinux --disabled # System bootloader configuration -bootloader --location=mbr +bootloader # Clear the Master Boot Record zerombr # Partition clearing information -clearpart --all --initlabel +clearpart --all --initlabel --disklabel=gpt # Disk partitioning information -part /boot --fstype=ext3 --size=1000 -part swap --fstype="swap" --recommended +part biosboot --fstype=biosboot --size=2 +part /boot --fstype=ext4 --size=1000 +part swap --fstype=swap --size=4096 part / --fstype=xfs --size=1 --grow # Reboot after installation @@ -48,7 +48,7 @@ sudo %post # Update the system -yum -y update +dnf -y update # Istall the EPEL repository dnf -y install epel-release diff --git a/http/rocky-9-server.ks b/http/rocky-server.ks similarity index 88% rename from http/rocky-9-server.ks rename to http/rocky-server.ks index 6cd08ef..837a7a6 100644 --- a/http/rocky-9-server.ks +++ b/http/rocky-server.ks @@ -6,14 +6,13 @@ keyboard --vckeymap=us --xlayouts='us' lang en_US.UTF-8 # System timezone -timezone America/New_York --isUtc +timezone America/New_York # Crypted root password rootpw --iscrypted $6$kkuIkd8S9gDUhK8g$1XbqJDCjt1zQAhxb9sC2mE5CGd.D0xV1efu0R8h1e.oovRKtEWqR5KaTDPSTztpxSw2qmDVORZJGnNpiJxUFT1 -# MD5 password hashing +# SHA512 password hashing authselect --useshadow --passalgo=sha512 # Create my initial user :D -#user --disabled user --name=xadmin --shell=/bin/bash --homedir=/home/xadmin --iscrypted --password=$6$8DdxHyrH6HfGZhDs$jEadYAMi3CTJivYgGjhG7S2C/ChZxv0w0L6AQ3Egn8K5xIA4OEqDngVfozfn.9kYxy.hWYpzwBE0qwytcU4BF0 network --device=eth0 --bootproto=dhcp --ipv6=auto --activate @@ -30,8 +29,9 @@ zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information -part /boot --fstype=ext3 --size=1000 -part swap --fstype="swap" --recommended +part biosboot --fstype=biosboot --size=2 +part /boot --fstype=ext4 --size=1000 +part swap --fstype=swap --size=4096 part / --fstype=xfs --size=1 --grow # Reboot after installation @@ -48,7 +48,7 @@ sudo %post # Update the system -yum -y update +dnf -y update # Istall the EPEL repository dnf -y install epel-release