Compare commits

..

47 Commits

Author SHA1 Message Date
1e9c3f461d Fixing the FreeBSD 14.2 ibuilder (finally) 2025-03-10 11:39:05 -04:00
87b7a3b8ab Upping the wait time on FreeBSD base OS install again... 2025-03-06 12:13:38 -05:00
b7318e1549 Updated the parameter to since it has been deprecated and removed 2025-03-06 12:08:09 -05:00
46a8616ba4 Upping the wait on the FreeBSD base OS download since it's taking longer now 2025-03-06 11:59:39 -05:00
2fcb082ccd Moved OS directories to be more generic instead of versioned 2025-03-06 11:54:10 -05:00
c490db3cb0 Updated ISO parameters to use the new ISO config block 2025-02-03 10:13:55 -05:00
e214d7b092 Fixed rocky linux 9 kickstart repo URL 2025-01-27 17:41:56 -05:00
97209dee64 Added checksums for ubuntu images 2025-01-27 17:26:36 -05:00
8167cb6554 Updating FreeBSD and Ubuntu images 2025-01-27 17:15:22 -05:00
fee73891e8 Added disk format value to 'qcow2', since the default is broken in proxmox plugin 1.2.1 and it really should be set anyway 2025-01-27 17:09:49 -05:00
6e08664e14 Updating Proxmox plugin to 1.2.1 2025-01-27 17:00:12 -05:00
caab68a92d Updating Almalinux 9 to 9.5 2025-01-27 16:33:33 -05:00
ea20c5848c Updating Debian image to 12.9 2025-01-27 16:31:25 -05:00
75ab6d02da Updating Rocky to 9.5 2025-01-27 16:15:58 -05:00
2cf2f865e6 Set a hard version requirement on the proxmox plugin; updated FreeBSD 14 image to 14.1 2024-10-08 23:54:28 -04:00
e94b05112b Added Ubuntu 24.04 stuff 2024-05-20 10:06:03 -04:00
d2ac6c777d Added Ubuntu 24.04 stuff 2024-05-20 10:04:41 -04:00
55cfdb03bf Added steps to resize the root disk on a FreeBSD system 2024-05-09 10:06:19 -06:00
6588979f8a Removed Salt installation steps from everything 2024-04-25 00:14:41 -04:00
5013fa83cc Updated FreeBSD installer to remove /etc/hostid 2024-04-25 00:05:08 -04:00
18e0214a21 Updated post-install script without salt 2024-04-24 23:12:59 -04:00
5a27129508 Fixed code that was removed from initial-setup 2024-04-23 13:10:46 -04:00
3b10d7ee0f Fixed a couple typos in the initial-setup script 2024-04-23 13:05:03 -04:00
2a1d0b520f Added initial-setup script file provisioner to all of the templates 2024-04-23 10:54:08 -04:00
d8fea80ded Fixed hostname setting and salt config in initial-setup script 2024-04-22 23:42:17 -04:00
060c35058d Added a script to run on initial system setup 2024-04-21 15:25:44 -04:00
e342cea6ef Updated freebsd-install to include the py39-tornado dependency for Salt 2024-04-21 13:10:57 -04:00
1a47889679 Small fixes to the ubuntu packer build and remove snap script 2024-04-21 12:59:29 -04:00
de5e7d31fd Added script to Ubuntu build to remove snap packages entirely 2024-04-21 12:32:29 -04:00
ae110e4fda Renamed post-install scripts to more accurately define when they're to be run 2024-04-21 12:30:20 -04:00
f438cb7c92 Changed all templates to use kamino for builds since it has more RAM 2024-04-21 01:55:46 -04:00
4e00aa8ba7 Improved on the post-install provisioning 2024-04-21 01:54:33 -04:00
a051724f38 Fully automated Ubuntu 22.04 install 2024-04-20 23:04:02 -04:00
cb410f3dc5 Standardized hardware config on templates to use better CPU and disk types; Updated Ubuntu 22, Rocky 9 and Almalinux 9 post-install stuff 2024-04-20 22:05:11 -04:00
86b8e70740 Maybe broken user-data? 2024-04-20 19:10:15 -04:00
082d12f3b7 Fixed boot command 2024-04-19 17:45:49 -04:00
0ff1cd0b1b Added ubuntu 22.04 config 2024-04-19 14:00:34 -04:00
ca7969baf3 Changed partition recipe for Debian installer 2024-04-19 09:39:58 -04:00
1b3a73bf20 Added files for Rocky 9; tried some fixes on Almalinux 9 to stop it from crashing 2024-04-19 09:34:57 -04:00
3210d922bf Updated Debian 12 to use a local preseed 2024-04-18 19:56:37 -04:00
770a3291b8 Increased boot wait time 2024-04-18 15:22:10 -04:00
2d64028486 Removed useless shutdown command; shortened key interval time 2024-04-18 11:40:59 -04:00
b682663c56 Added image for Debian 2024-04-18 11:40:13 -04:00
5883f10ecf Increased number of CPU cores available to builds; defined OS type 2024-04-18 11:37:20 -04:00
700bb4dfbd Increasing amount of memory available to builds 2024-04-18 11:34:46 -04:00
ec7d42a75a Reduced boot wait times to slightly speed up the builds 2024-04-18 11:33:02 -04:00
8fa506613b Created config for ALmalinux 9 2024-04-18 11:25:21 -04:00
19 changed files with 859 additions and 72 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-9" {
template_name = "almalinux-9"
template_description = "Almalinux 9.5, 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>"]
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/9.5/isos/x86_64/AlmaLinux-9.5-x86_64-boot.iso"
iso_checksum = "sha256:3038fb71a29d33c3c93117bd8f4c3f612cb152dce057c666b6b11dfa793fb65c"
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-9"]
provisioner "shell" {
script = "scripts/rhel-install.sh"
}
provisioner "file" {
source = "scripts/initial-setup.sh"
destination = "/home/xadmin/initial-setup.sh"
}
}

72
Debian/debian-12.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" "debian-12" {
template_name = "debian-12"
template_description = "Debian 12.9, generated on ${timestamp()}"
vm_id = "203"
boot_wait = "10s"
boot_key_interval = "200ms"
boot_command = ["<esc><wait1s>", "auto url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian.cfg", "<enter><wait>"]
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://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"
ssh_timeout = "20m"
}
build {
sources = ["source.proxmox-iso.debian-12"]
provisioner "shell" {
script = "scripts/debian-install.sh"
}
provisioner "file" {
source = "scripts/initial-setup.sh"
destination = "/home/xadmin/initial-setup.sh"
}
}

View File

@ -1,47 +0,0 @@
variable "proxmox_apiuser" {
type = string
default = "packer"
}
variable "proxmox_apitoken" {
type = string
default = "changeme"
}
source "proxmox-iso" "freebsd-14" {
template_name = "freebsd-14"
template_description = "FreeBSD 14.0, generated on ${timestamp()}"
boot_wait = "10s"
boot_key_interval = "250ms"
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><wait75s>", "packer<enter><wait1s>", "packer<enter><wait1s>", "<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>", "packer<enter>", "packer<enter>", "<enter>", "<enter>", "<enter><wait1s>", "<enter><wait1s>", "<left><enter><wait1s>", "pkg update && pkg install -y sudo qemu-guest-agent<enter><wait3s>", "y<enter><wait40s>", "echo '%wheel ALL=(ALL:ALL) ALL' > /usr/local/etc/sudoers.d/wheel<enter><wait1s>", "echo 'qemu_guest_agent_enable=\"YES\"' >> /etc/rc.conf<enter><wait1s>", "exit<enter><wait1s>", "<enter><wait40s>"]
# shutdown_command = "echo 'packer' | sudo -S poweroff"
disks {
disk_size = "10G"
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 = "geonosis"
iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.0/FreeBSD-14.0-RELEASE-amd64-bootonly.iso"
iso_checksum = "sha256:71db8160a2339634bd9fbabbf10dd868148ebc9e1b08c1d8c4e5b954d30941ec"
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.freebsd-14"]
}

View File

@ -0,0 +1,68 @@
variable "proxmox_apiuser" {
type = string
default = "packer"
}
variable "proxmox_apitoken" {
type = string
default = "changeme"
}
source "proxmox-iso" "freebsd-14" {
template_name = "freebsd-14"
template_description = "FreeBSD 14.2, 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><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"
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.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-bootonly.iso"
iso_checksum = "sha256:d063e48b81b99005c8097e60377c23fb07e4116c5f0c0b41a5dc368fc4df6bf9"
iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin"
ssh_password = "packer"
ssh_timeout = "20m"
}
build {
sources = ["source.proxmox-iso.freebsd-14"]
provisioner "shell" {
script = "scripts/freebsd-install.sh"
}
provisioner "file" {
source = "scripts/initial-setup.sh"
destination = "/home/xadmin/initial-setup.sh"
}
}

72
Rocky/rocky-9.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-9" {
template_name = "rocky-9"
template_description = "Rocky Linux 9.5, 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>"]
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/9/isos/x86_64/Rocky-9.5-x86_64-boot.iso"
iso_checksum = "sha256:628c069c9685477360640a6b58dc919692a11c44b49a50a024b5627ce3c27d5f"
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-9"]
provisioner "shell" {
script = "scripts/rhel-install.sh"
}
provisioner "file" {
source = "scripts/initial-setup.sh"
destination = "/home/xadmin/initial-setup.sh"
}
}

86
Ubuntu/ubuntu-22.pkr.hcl Normal file
View File

@ -0,0 +1,86 @@
variable "proxmox_apiuser" {
type = string
default = "packer"
}
variable "proxmox_apitoken" {
type = string
default = "changeme"
}
source "proxmox-iso" "ubuntu-22" {
template_name = "ubuntu-22"
template_description = "Ubuntu 22.04, generated on ${timestamp()}"
vm_id = "205"
boot_wait = "10s"
boot_key_interval = "200ms"
boot_command = [
# Edit boot options
"e<wait>",
# Go to the end of the boot command
"<down><down><down><down><left> <wait>",
# Add kernel command-line to start autoinstall
"autoinstall ",
"ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/\"",
"<leftCtrlOn>x<leftCtrlOff><wait>"
]
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://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"
ssh_timeout = "20m"
}
build {
sources = ["source.proxmox-iso.ubuntu-22"]
provisioner "shell" {
scripts = [
"scripts/debian-install.sh",
"scripts/remove-snap.sh"
]
}
provisioner "file" {
source = "scripts/initial-setup.sh"
destination = "/home/xadmin/initial-setup.sh"
}
}

86
Ubuntu/ubuntu-24.pkr.hcl Normal file
View File

@ -0,0 +1,86 @@
variable "proxmox_apiuser" {
type = string
default = "packer"
}
variable "proxmox_apitoken" {
type = string
default = "changeme"
}
source "proxmox-iso" "ubuntu-24" {
template_name = "ubuntu-24"
template_description = "Ubuntu 24.04, generated on ${timestamp()}"
vm_id = "206"
boot_wait = "10s"
boot_key_interval = "200ms"
boot_command = [
# Edit boot options
"e<wait>",
# Go to the end of the boot command
"<down><down><down><down><left> <wait>",
# Add kernel command-line to start autoinstall
"autoinstall ",
"ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/\"",
"<leftCtrlOn>x<leftCtrlOff><wait>"
]
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://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"
ssh_timeout = "20m"
}
build {
sources = ["source.proxmox-iso.ubuntu-24"]
provisioner "shell" {
scripts = [
"scripts/debian-install.sh",
"scripts/remove-snap.sh"
]
}
provisioner "file" {
source = "scripts/initial-setup.sh"
destination = "/home/xadmin/initial-setup.sh"
}
}

View File

@ -1,23 +0,0 @@
source "qemu" "almalinux-9" {
iso_url = "https://repo.almalinux.org/almalinux/9.3/isos/x86_64/AlmaLinux-9.3-x86_64-boot.iso"
iso_checksum = "sha256:af5377a1d16bbe599ea91a8761ad645f2f54687075802bdc0c0703ee610182e9"
output_directory = "/srv/kvm/templates/"
shutdown_command = "echo 'packer' | sudo -S poweroff"
disk_size = "5000M"
format = "qcow2"
accelerator = "kvm"
headless = "true"
ssh_username = "xadmin"
ssh_password = "packer"
ssh_timeout = "20m"
vnc_bind_address = "0.0.0.0"
vm_name = "almalinux-9"
net_device = "virtio-net"
disk_interface = "virtio"
boot_wait = "10s"
boot_command = ["<tab> text inst.ks=http://ks-v1.int.metaunix.net/kickstarts/almalinux-9-server.ks<enter><wait>"]
}
build {
sources = ["source.qemu.almalinux-9"]
}

View File

@ -0,0 +1,61 @@
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$8DdxHyrH6HfGZhDs$jEadYAMi3CTJivYgGjhG7S2C/ChZxv0w0L6AQ3Egn8K5xIA4OEqDngVfozfn.9kYxy.hWYpzwBE0qwytcU4BF0
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
bash
nfs-utils
sudo
%end
%post
# Update the system
yum -y update
# Istall the EPEL repository
dnf -y install epel-release
dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent
echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/xadmin
systemctl enable qemu-guest-agent
%end

163
http/debian.cfg Normal file
View File

@ -0,0 +1,163 @@
#### Contents of the preconfiguration file (for wheezy)
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# Keyboard selection.
d-i keymap select us
d-i keyboard-configuration/xkb-keymap select us
d-i console-keymaps-at/keymap select us
### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
# If you want the preconfiguration file to work on systems both with and
# without a dhcp server, uncomment these lines and the static network
# configuration below.
#d-i netcfg/dhcp_failed note
#d-i netcfg/dhcp_options select Configure network manually
# Any hostname and domain names assigned from dhcp take precedence over values set here.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
# Force a hostname
#d-i netcfg/hostname string somehost
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
# If non-free firmware is needed for the network or other hardware, this will try to load it
d-i hw-detect/load_firmware boolean true
### Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string http.us.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
### Account setup
# Root password,
d-i passwd/root-password-crypted password $6$CPlWX.5WLxqmNT2$VSJcR9FIZq4Efq32hMHmsB.qN7mbvDxxi3MueUjGVeSKp.t9EgYz5qFNWYpWKyvA66erkhJcHrqN3p/kgm/Y./
# To create a normal user account.
d-i passwd/user-fullname string Remote admin user
d-i passwd/username string xadmin
d-i passwd/user-password-crypted password $6$8DdxHyrH6HfGZhDs$jEadYAMi3CTJivYgGjhG7S2C/ChZxv0w0L6AQ3Egn8K5xIA4OEqDngVfozfn.9kYxy.hWYpzwBE0qwytcU4BF0
d-i passwd/user-uid string 1000
### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean false
# You may set this to any valid setting for $TZ; see the contents of /usr/share/zoneinfo/ for valid values.
d-i time/zone string America/New_York
# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
# NTP server to use. The default is almost always fine here.
d-i clock-setup/ntp-server string ntp.example.com
### Partitioning
#d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-lvm/purge_lvm_from_device boolean true
d-i partman-md/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
# atomic: all files in one partition
# home: separate /home partition
# multi: separate /home, /usr, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic
#d-i partman-auto/expert_recipe string \
# boot-root :: \
# 1000 1000 1000 ext3 \
# $primary{ } $bootable{ } \
# method{ format } format{ } \
# use_filesystem{ } filesystem{ ext3 } \
# mountpoint{ /boot } \
# . \
# 256 512 768 linux-swap \
# method{ swap } format{ } \
# . \
# 5000 10000 1000000000 xfs \
# method{ format } format{ } \
# use_filesystem{ } filesystem{ xfs } \
# mountpoint{ / } \
# .
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
## Controlling how partitions are mounted
# The default is to mount by UUID, but you can also choose "traditional" to
# use traditional device names, or "label" to try filesystem labels before
# falling back to UUIDs.
d-i partman/mount_style select uuid
## Installing the bootloader
# This is fairly safe to set, it makes grub install automatically to the MBR
# if no other operating system is detected on the machine.
d-i grub-installer/only_debian boolean true
### Base system installation
# The kernel image (meta) package to be installed; "none" can be used if no
# kernel is to be installed.
d-i base-installer/kernel/image string linux-image-486
### Apt setup
# You can choose to install non-free and contrib software.
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
# Uncomment this if you don't want to use a network mirror.
#d-i apt-setup/use_mirror boolean false
# Select which update services to use; define the mirrors to be used.
# Values shown below are the normal defaults.
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.debian.org
# By default the installer requires that repositories be authenticated using a known gpg key.
d-i debian-installer/allow_unauthenticated boolean true
# Select the boot device to install to
d-i grub-installer/bootdev string default
# This will eject the installation media upon reboot
d-i cdrom-detect/eject boolean true
# Install combination of stuff
tasksel tasksel/first multiselect standard
# Individual additional packages to install
d-i pkgsel/include string \
apt-transport-https \
bash \
curl \
dnsutils \
openssh-server \
nfs-common \
qemu-guest-agent \
sudo \
vim
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
d-i pkgsel/upgrade select none
# Some versions of the installer can report back on what software you have installed, and what software you use.
popularity-contest popularity-contest/participate boolean false
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
#### Advanced options
# This first command is run as early as possible, just after preseeding is read.
#d-i preseed/early_command string anna-install some-udeb
# This command is run just before the install finishes, but when there is still a usable /target directory.
#d-i preseed/late_command string in-target wget -O /root/post-install.sh http://tarsonis.metaunix.net/scripts/post-install.sh; in-target chmod +x /root/post-install.sh; in-target /root/post-install.sh
d-i preseed/late_command string in-target systemctl enable qemu-guest-agent; \
echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/xadmin;

61
http/rocky-9-server.ks Normal file
View File

@ -0,0 +1,61 @@
url --url="https://dl.rockylinux.org/pub/rocky/$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$8DdxHyrH6HfGZhDs$jEadYAMi3CTJivYgGjhG7S2C/ChZxv0w0L6AQ3Egn8K5xIA4OEqDngVfozfn.9kYxy.hWYpzwBE0qwytcU4BF0
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
bash
nfs-utils
sudo
%end
%post
# Update the system
yum -y update
# Istall the EPEL repository
dnf -y install epel-release
dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent
echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/xadmin
systemctl enable qemu-guest-agent
%end

0
http/ubuntu/meta-data Normal file
View File

45
http/ubuntu/user-data Normal file
View File

@ -0,0 +1,45 @@
#cloud-config
autoinstall:
version: 1
early-commands:
- systemctl stop ssh
locale: en_US.UTF-8
keyboard:
layout: us
apt:
geoip: true
preserve_sources_list: false
primary:
- arches: [i386, amd64]
uri: "http://archive.ubuntu.com/ubuntu"
storage:
layout:
name: lvm
identity:
hostname: ubuntu
username: xadmin
password: $6$8DdxHyrH6HfGZhDs$jEadYAMi3CTJivYgGjhG7S2C/ChZxv0w0L6AQ3Egn8K5xIA4OEqDngVfozfn.9kYxy.hWYpzwBE0qwytcU4BF0
user-data:
disable_root: true
package_upgrade: true
ssh:
allow-pw: true
authorized-keys: []
install-server: true
packages:
- "qemu-guest-agent"
late-commands:
- "echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/xadmin"
- "chmod 440 /target/etc/sudoers.d/xadmin"
- "curtin in-target --target=/target -- apt install -y qemu-guest-agent"
- "curtin in-target --target=/target -- systemctl enable qemu-guest-agent"
- "curtin in-target --target=/target -- systemctl start qemu-guest-agent"

View File

@ -1,9 +1,8 @@
packer { packer {
required_plugins { required_plugins {
name = { name = {
version = "~> 1" version = "1.2.1"
source = "github.com/hashicorp/proxmox" source = "github.com/hashicorp/proxmox"
} }
} }
} }

View File

@ -0,0 +1,8 @@
#!/bin/sh
# Debian/Ubuntu steps
sudo apt update
sudo apt upgrade -y
sudo apt install -y vim

View File

@ -0,0 +1,17 @@
#!/bin/sh
# 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 puppet8
echo "\n[agent]\nserver = puppet-v2.int.metaunix.net\nruninterval = 6h\n" | sudo tee -a /usr/local/etc/puppet/puppet.conf

35
scripts/initial-setup.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash
PUPPET_MASTER='puppet-v1.int.metaunix.net'
# determine OS version
if [ -f '/etc/redhat-release' ]; then
OS="rhel"
elif [ -f '/etc/debian_version' ]; then
OS="debian"
elif [ -d '/etc/ubuntu-advantage' ]; then
OS="ubuntu"
else
OS="freebsd"
fi
read -p 'System hostname: ' HOSTNAME
read -p 'System domain: ' DOMAIN
if [ "$OS" = 'freebsd' ]; then
# Configure system hostname
sysrc hostname="$HOSTNAME.$DOMAIN"
# Expand file system to match disk's bounds
gpart recover da0 # run this first in case the disk is corrupted
camcontrol reprobe da0 # force re-probing of the disk info
gpart resize -i 3 da0 # re-size the root partition automatically
zpool online -e zroot da0p3 # make ZFS resize the volume to match
# Install Puppet
echo -e "[agent]\nserver = $PUPPET_MASTER" > /usr/local/etc/puppet/puppet.conf
sysrc puppet_enable="YES"
else
# Configure system hostname
hostnamectl set-hostname "$HOSTNAME"
fi

6
scripts/remove-snap.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
sudo apt purge -y snapd
sudo rm -rf /var/lib/snap
sudo rm -rf /root/snap

6
scripts/rhel-install.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
sudo dnf update -y
sudo dnf install -y vim