Compare commits

...

8 Commits

11 changed files with 218 additions and 51 deletions

View File

@ -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<wait1s>", "<down><down><down><left> inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux-server.ks", "<wait>", "<leftCtrlOn>x<leftCtrlOff>", "<wait3s>"]
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"
}
}

View File

@ -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 = ["<tab><wait1s>", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux-9-server.ks<enter><wait5m>"]
boot_command = ["<tab><wait1s>", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/almalinux-server.ks", "<enter>", "<wait5s>"]
http_directory = "http"
http_port_max = "8089"
@ -44,11 +44,14 @@ source "proxmox-iso" "almalinux-9" {
node = "kamino"
pool = "Templates"
iso_url = "https://repo.almalinux.org/almalinux/9.5/isos/x86_64/AlmaLinux-9.5-x86_64-boot.iso"
iso_checksum = "sha256:3038fb71a29d33c3c93117bd8f4c3f612cb152dce057c666b6b11dfa793fb65c"
iso_storage_pool = "iso"
unmount_iso = true
iso_download_pve = true
boot_iso {
type = "scsi"
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
}
ssh_username = "xadmin"
ssh_password = "packer"

View File

@ -44,11 +44,14 @@ source "proxmox-iso" "debian-12" {
node = "kamino"
pool = "Templates"
iso_url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.9.0-amd64-netinst.iso"
iso_checksum = "sha256:1257373c706d8c07e6917942736a865dfff557d21d76ea3040bb1039eb72a054"
iso_storage_pool = "iso"
unmount_iso = true
iso_download_pve = true
boot_iso {
type = "scsi"
iso_url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.9.0-amd64-netinst.iso"
iso_checksum = "sha256:1257373c706d8c07e6917942736a865dfff557d21d76ea3040bb1039eb72a054"
iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin"
ssh_password = "packer"

View File

@ -10,11 +10,11 @@ variable "proxmox_apitoken" {
source "proxmox-iso" "freebsd-14" {
template_name = "freebsd-14"
template_description = "FreeBSD 14.2, generated on ${timestamp()}"
template_description = "FreeBSD 14.3, generated on ${timestamp()}"
vm_id = "202"
boot_wait = "10s"
boot_key_interval = "200ms"
boot_command = ["<enter>", "<wait15s>", "<enter><wait1s>", "<enter><wait1s>", "freebsd", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait5s>", "<right><enter><wait1s>", "<enter><wait1s>", "<enter><wait4s>", "<enter><wait1s>", "<enter><wait1s>", " <enter><wait1s>", "<left><enter><wait1s>", "<enter><wait80s>", "packer<enter><wait1s>", "packer<enter><wait1s>", "<down><down><enter><wait1s>", "95<up><enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<down><down><down> <enter><wait1s>", "<down><down><down><down><down><down><down><down> <enter><wait1s>", "<enter><wait1s>", "xadmin<enter>", "Remote admin user<enter>", "<enter>", "<enter>", "wheel<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "packer<enter>", "packer<enter>", "<enter>", "<enter>", "<enter><wait1s>", "<enter><wait1s>", "<left><enter><wait1s>", "pkg update && pkg install -y bash sudo qemu-guest-agent<enter><wait3s>", "y<enter><wait40s>", "echo 'xadmin ALL=(ALL:ALL) NOPASSWD:ALL' > /usr/local/etc/sudoers.d/xadmin<enter><wait1s>", "echo 'qemu_guest_agent_enable=\"YES\"' >> /etc/rc.conf<enter><wait1s>", "exit<enter><wait1s>", "<enter><wait40s>"]
boot_command = ["<enter>", "<wait15s>", "<enter><wait1s>", "<enter><wait1s>", "freebsd", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait5s>", "<right><enter><wait1s>", "<enter><wait1s>", "<enter><wait4s>", "<enter><wait1s>", "<enter><wait1s>", " <enter><wait1s>", "<left><enter><wait1s>", "<enter><wait100s>", "packer<enter><wait1s>", "packer<enter><wait1s>", "<down><down><enter><wait1s>", "95<up><enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<enter><wait1s>", "<down><down><down> <enter><wait1s>", "<down><down><down><down><down><down><down><down> <enter><wait1s>", "<enter><wait2s>", "<enter><wait1s>", "xadmin<enter>", "Remote admin user<enter>", "<enter>", "<enter>", "wheel<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "<enter>", "packer<enter>", "packer<enter>", "<enter>", "<enter>", "<enter><wait1s>", "<enter><wait1s>", "<left><enter><wait1s>", "pkg install -y qemu-guest-agent sudo<enter><wait30s>", "echo 'xadmin ALL=(ALL:ALL) NOPASSWD:ALL' > /usr/local/etc/sudoers.d/xadmin<enter><wait1s>", "sysrc qemu_guest_agent_enable=YES<enter><wait1s>", "exit<enter><wait1s>", "<enter>"]
os = "other"
cores = "2"
@ -40,11 +40,14 @@ source "proxmox-iso" "freebsd-14" {
node = "kamino"
pool = "Templates"
iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-bootonly.iso"
iso_checksum = "sha256:d063e48b81b99005c8097e60377c23fb07e4116c5f0c0b41a5dc368fc4df6bf9"
iso_storage_pool = "iso"
unmount_iso = true
iso_download_pve = true
boot_iso {
type = "scsi"
iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.3/FreeBSD-14.3-RELEASE-amd64-bootonly.iso"
iso_checksum = "sha256:b3c242b27e0dda3efc280c4a68f5cbe0b8dbc50d7993baadef7617bf32b17f0c"
iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin"
ssh_password = "packer"

72
Rocky/rocky-10.pkr.hcl Normal file
View File

@ -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<wait1s>", "<down><down><down><left> inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky-server.ks", "<wait>", "<leftCtrlOn>x<leftCtrlOff>", "<wait3s>"]
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"
}
}

View File

@ -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 = ["<tab><wait1s>", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky-9-server.ks<enter><wait5m>"]
boot_command = ["<tab><wait1s>", " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rocky-server.ks", "<enter>", "<wait5s>"]
http_directory = "http"
http_port_max = "8089"
@ -44,11 +44,14 @@ source "proxmox-iso" "rocky-9" {
node = "kamino"
pool = "Templates"
iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.5-x86_64-boot.iso"
iso_checksum = "sha256:628c069c9685477360640a6b58dc919692a11c44b49a50a024b5627ce3c27d5f"
iso_storage_pool = "iso"
unmount_iso = true
iso_download_pve = true
boot_iso {
type = "scsi"
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
}
ssh_username = "xadmin"
ssh_password = "packer"

View File

@ -55,11 +55,14 @@ source "proxmox-iso" "ubuntu-22" {
node = "kamino"
pool = "Templates"
iso_url = "https://releases.ubuntu.com/22.04.5/ubuntu-22.04.5-live-server-amd64.iso"
iso_checksum = "sha256:9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0"
iso_storage_pool = "iso"
unmount_iso = true
iso_download_pve = true
boot_iso {
type = "scsi"
iso_url = "https://releases.ubuntu.com/22.04.5/ubuntu-22.04.5-live-server-amd64.iso"
iso_checksum = "sha256:9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0"
iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin"
ssh_password = "packer"

View File

@ -55,11 +55,14 @@ source "proxmox-iso" "ubuntu-24" {
node = "kamino"
pool = "Templates"
iso_url = "https://releases.ubuntu.com/24.04.1/ubuntu-24.04.1-live-server-amd64.iso"
iso_checksum = "sha256:e240e4b801f7bb68c20d1356b60968ad0c33a41d00d828e74ceb3364a0317be9"
iso_storage_pool = "iso"
unmount_iso = true
iso_download_pve = true
boot_iso {
type = "scsi"
iso_url = "https://releases.ubuntu.com/24.04.1/ubuntu-24.04.1-live-server-amd64.iso"
iso_checksum = "sha256:e240e4b801f7bb68c20d1356b60968ad0c33a41d00d828e74ceb3364a0317be9"
iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin"
ssh_password = "packer"

View File

@ -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

View File

@ -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

View File

@ -3,10 +3,15 @@
# FreeBSD steps
sudo pkg update
sudo pkg upgrade -y
sudo pkg autoremove -y
# install QEMU guest agent
sudo pkg install -y bash
# Delete /etc/hostid so it gets regenerated
sudo rm /etc/hostid
# Install Puppet
sudo pkg install -y puppet7
sudo pkg install -y puppet8
echo "\n[agent]\nserver = puppet-v2.int.metaunix.net\nruninterval = 6h\n" | sudo tee -a /usr/local/etc/puppet/puppet.conf