diff --git a/Almalinux-9/almalinux-9.pkr.hcl b/Almalinux-9/almalinux-9.pkr.hcl index 84f013d..81219dc 100644 --- a/Almalinux-9/almalinux-9.pkr.hcl +++ b/Almalinux-9/almalinux-9.pkr.hcl @@ -13,14 +13,18 @@ source "proxmox-iso" "almalinux-9" { template_description = "Almalinux 9.3, generated on ${timestamp()}" boot_wait = "10s" boot_key_interval = "200ms" - boot_command = ["", " inst.ks=http://ks.int.metaunix.net/kickstarts/almalinux-9-server.ks"] + boot_command = ["", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux-9-server.ks"] + + http_directory = "http" + http_port_max = "8089" + http_port_min = "8080" os = "l26" cores = "2" sockets = "1" memory = "2048" disks { - disk_size = "10G" + disk_size = "30G" storage_pool = "templates" type = "scsi" } diff --git a/Rocky-9/rocky-9.pkr.hcl b/Rocky-9/rocky-9.pkr.hcl new file mode 100644 index 0000000..552d367 --- /dev/null +++ b/Rocky-9/rocky-9.pkr.hcl @@ -0,0 +1,57 @@ +variable "proxmox_apiuser" { + type = string + default = "packer" +} + +variable "proxmox_apitoken" { + type = string + default = "changeme" +} + +source "proxmox-iso" "rocky-9" { + template_name = "rocky-9" + template_description = "Rocky Linux 9.3, generated on ${timestamp()}" + boot_wait = "10s" + boot_key_interval = "200ms" + boot_command = ["", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky-9-server.ks"] + + http_directory = "http" + http_port_max = "8089" + http_port_min = "8080" + + os = "l26" + machine = "pc" + scsi_controller = "virtio-scsi-single" + cores = "2" + sockets = "1" + memory = "2048" + disks { + disk_size = "30G" + storage_pool = "templates" + type = "scsi" + } + 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" + + iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.3-x86_64-boot.iso" + iso_checksum = "sha256:eb096f0518e310f722d5ebd4c69f0322df4fc152c6189f93c5c797dc25f3d2e1" + iso_storage_pool = "iso" + unmount_iso = true + iso_download_pve = true + + ssh_username = "xadmin" + ssh_password = "packer" + ssh_timeout = "20m" +} + +build { + sources = ["source.proxmox-iso.rocky-9"] +} diff --git a/http/almalinux-9-server.ks b/http/almalinux-9-server.ks new file mode 100644 index 0000000..f78a3d7 --- /dev/null +++ b/http/almalinux-9-server.ks @@ -0,0 +1,62 @@ +url --url="https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/" + +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# System timezone +timezone America/New_York --isUtc + +# Crypted root password +rootpw --iscrypted $6$kkuIkd8S9gDUhK8g$1XbqJDCjt1zQAhxb9sC2mE5CGd.D0xV1efu0R8h1e.oovRKtEWqR5KaTDPSTztpxSw2qmDVORZJGnNpiJxUFT1 +# MD5 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$y6lN/cfPPtlyaTXu$4QUYFl816sxWPuyR.eY6mCJ3ybYLNcF6Pw4ar4K7Dyy9LbedK3PjkTNZfWqSdoPRpJMjtrbpY1xQ.zDXxOTug. + +network --device=eth0 --bootproto=dhcp --ipv6=auto --activate + +# Run the Setup Agent on first boot +firstboot --disable +# SELinux configuration +selinux --disabled + +# System bootloader configuration +bootloader --location=mbr +# Clear the Master Boot Record +zerombr +# Partition clearing information +clearpart --all --initlabel +# Disk partitioning information +part /boot --fstype=ext3 --size=1000 +part swap --fstype="swap" --recommended +part / --fstype=xfs --size=1 --grow + +# Reboot after installation +reboot --eject + +%packages +@base +@core +nfs-utils +sudo +qemu-guest-agent + +%end + +%post +# Update the system +yum -y update +# Istall the EPEL repository +yum -y install epel-release + +yum -y install wget vim yum-plugin-versionlock + +usermod -aG wheel xadmin + +systemctl enable qemu-guest-agent + +%end + diff --git a/http/rocky-9-server.ks b/http/rocky-9-server.ks new file mode 100644 index 0000000..f78a3d7 --- /dev/null +++ b/http/rocky-9-server.ks @@ -0,0 +1,62 @@ +url --url="https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/" + +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# System timezone +timezone America/New_York --isUtc + +# Crypted root password +rootpw --iscrypted $6$kkuIkd8S9gDUhK8g$1XbqJDCjt1zQAhxb9sC2mE5CGd.D0xV1efu0R8h1e.oovRKtEWqR5KaTDPSTztpxSw2qmDVORZJGnNpiJxUFT1 +# MD5 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$y6lN/cfPPtlyaTXu$4QUYFl816sxWPuyR.eY6mCJ3ybYLNcF6Pw4ar4K7Dyy9LbedK3PjkTNZfWqSdoPRpJMjtrbpY1xQ.zDXxOTug. + +network --device=eth0 --bootproto=dhcp --ipv6=auto --activate + +# Run the Setup Agent on first boot +firstboot --disable +# SELinux configuration +selinux --disabled + +# System bootloader configuration +bootloader --location=mbr +# Clear the Master Boot Record +zerombr +# Partition clearing information +clearpart --all --initlabel +# Disk partitioning information +part /boot --fstype=ext3 --size=1000 +part swap --fstype="swap" --recommended +part / --fstype=xfs --size=1 --grow + +# Reboot after installation +reboot --eject + +%packages +@base +@core +nfs-utils +sudo +qemu-guest-agent + +%end + +%post +# Update the system +yum -y update +# Istall the EPEL repository +yum -y install epel-release + +yum -y install wget vim yum-plugin-versionlock + +usermod -aG wheel xadmin + +systemctl enable qemu-guest-agent + +%end +