Compare commits

...

33 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
18 changed files with 334 additions and 97 deletions

View File

@ -10,7 +10,8 @@ variable "proxmox_apitoken" {
source "proxmox-iso" "almalinux-9" { source "proxmox-iso" "almalinux-9" {
template_name = "almalinux-9" template_name = "almalinux-9"
template_description = "Almalinux 9.3, generated on ${timestamp()}" template_description = "Almalinux 9.5, generated on ${timestamp()}"
vm_id = "204"
boot_wait = "10s" boot_wait = "10s"
boot_key_interval = "200ms" 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-9-server.ks<enter><wait5m>"]
@ -29,6 +30,7 @@ source "proxmox-iso" "almalinux-9" {
disk_size = "30G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"
type = "scsi" type = "scsi"
format = "qcow2"
} }
network_adapters { network_adapters {
bridge = "vmbr0" bridge = "vmbr0"
@ -39,13 +41,17 @@ source "proxmox-iso" "almalinux-9" {
insecure_skip_tls_verify = true insecure_skip_tls_verify = true
username = "${var.proxmox_apiuser}" username = "${var.proxmox_apiuser}"
password = "${var.proxmox_apitoken}" password = "${var.proxmox_apitoken}"
node = "geonosis" node = "kamino"
pool = "Templates"
iso_url = "https://repo.almalinux.org/almalinux/9.3/isos/x86_64/AlmaLinux-9.3-x86_64-boot.iso" boot_iso {
iso_checksum = "sha256:af5377a1d16bbe599ea91a8761ad645f2f54687075802bdc0c0703ee610182e9" type = "scsi"
iso_storage_pool = "iso" iso_url = "https://repo.almalinux.org/almalinux/9.5/isos/x86_64/AlmaLinux-9.5-x86_64-boot.iso"
unmount_iso = true iso_checksum = "sha256:3038fb71a29d33c3c93117bd8f4c3f612cb152dce057c666b6b11dfa793fb65c"
iso_download_pve = true iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin" ssh_username = "xadmin"
ssh_password = "packer" ssh_password = "packer"
@ -54,4 +60,13 @@ source "proxmox-iso" "almalinux-9" {
build { build {
sources = ["source.proxmox-iso.almalinux-9"] 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"
}
} }

View File

@ -10,10 +10,11 @@ variable "proxmox_apitoken" {
source "proxmox-iso" "debian-12" { source "proxmox-iso" "debian-12" {
template_name = "debian-12" template_name = "debian-12"
template_description = "Debian 12.5, generated on ${timestamp()}" template_description = "Debian 12.9, generated on ${timestamp()}"
vm_id = "203"
boot_wait = "10s" boot_wait = "10s"
boot_key_interval = "200ms" boot_key_interval = "200ms"
boot_command = ["<esc><wait1s>", "auto url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian.cfg", "<enter><wait6m>"] boot_command = ["<esc><wait1s>", "auto url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian.cfg", "<enter><wait>"]
http_directory = "http" http_directory = "http"
http_port_max = "8089" http_port_max = "8089"
@ -29,6 +30,7 @@ source "proxmox-iso" "debian-12" {
disk_size = "30G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"
type = "scsi" type = "scsi"
format = "qcow2"
} }
network_adapters { network_adapters {
bridge = "vmbr0" bridge = "vmbr0"
@ -39,13 +41,17 @@ source "proxmox-iso" "debian-12" {
insecure_skip_tls_verify = true insecure_skip_tls_verify = true
username = "${var.proxmox_apiuser}" username = "${var.proxmox_apiuser}"
password = "${var.proxmox_apitoken}" password = "${var.proxmox_apitoken}"
node = "geonosis" node = "kamino"
pool = "Templates"
iso_url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso" boot_iso {
iso_checksum = "sha256:013f5b44670d81280b5b1bc02455842b250df2f0c6763398feb69af1a805a14f" type = "scsi"
iso_storage_pool = "iso" iso_url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.9.0-amd64-netinst.iso"
unmount_iso = true iso_checksum = "sha256:1257373c706d8c07e6917942736a865dfff557d21d76ea3040bb1039eb72a054"
iso_download_pve = true iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin" ssh_username = "xadmin"
ssh_password = "packer" ssh_password = "packer"
@ -54,4 +60,13 @@ source "proxmox-iso" "debian-12" {
build { build {
sources = ["source.proxmox-iso.debian-12"] 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,53 +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 = "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><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>"]
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"
}
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"
}
}

View File

@ -10,7 +10,8 @@ variable "proxmox_apitoken" {
source "proxmox-iso" "rocky-9" { source "proxmox-iso" "rocky-9" {
template_name = "rocky-9" template_name = "rocky-9"
template_description = "Rocky Linux 9.3, generated on ${timestamp()}" template_description = "Rocky Linux 9.5, generated on ${timestamp()}"
vm_id = "201"
boot_wait = "10s" boot_wait = "10s"
boot_key_interval = "200ms" 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-9-server.ks<enter><wait5m>"]
@ -29,6 +30,7 @@ source "proxmox-iso" "rocky-9" {
disk_size = "30G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"
type = "scsi" type = "scsi"
format = "qcow2"
} }
network_adapters { network_adapters {
bridge = "vmbr0" bridge = "vmbr0"
@ -39,13 +41,17 @@ source "proxmox-iso" "rocky-9" {
insecure_skip_tls_verify = true insecure_skip_tls_verify = true
username = "${var.proxmox_apiuser}" username = "${var.proxmox_apiuser}"
password = "${var.proxmox_apitoken}" password = "${var.proxmox_apitoken}"
node = "geonosis" node = "kamino"
pool = "Templates"
iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.3-x86_64-boot.iso" boot_iso {
iso_checksum = "sha256:eb096f0518e310f722d5ebd4c69f0322df4fc152c6189f93c5c797dc25f3d2e1" type = "scsi"
iso_storage_pool = "iso" iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.5-x86_64-boot.iso"
unmount_iso = true iso_checksum = "sha256:628c069c9685477360640a6b58dc919692a11c44b49a50a024b5627ce3c27d5f"
iso_download_pve = true iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin" ssh_username = "xadmin"
ssh_password = "packer" ssh_password = "packer"
@ -54,4 +60,13 @@ source "proxmox-iso" "rocky-9" {
build { build {
sources = ["source.proxmox-iso.rocky-9"] 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"
}
} }

View File

@ -10,7 +10,8 @@ variable "proxmox_apitoken" {
source "proxmox-iso" "ubuntu-22" { source "proxmox-iso" "ubuntu-22" {
template_name = "ubuntu-22" template_name = "ubuntu-22"
template_description = "Rocky Linux 9.3, generated on ${timestamp()}" template_description = "Ubuntu 22.04, generated on ${timestamp()}"
vm_id = "205"
boot_wait = "10s" boot_wait = "10s"
boot_key_interval = "200ms" boot_key_interval = "200ms"
boot_command = [ boot_command = [
@ -20,12 +21,9 @@ source "proxmox-iso" "ubuntu-22" {
# Go to the end of the boot command # Go to the end of the boot command
"<down><down><down><down><left> <wait>", "<down><down><down><down><left> <wait>",
# Add kernel command-line and start install # Add kernel command-line to start autoinstall
"linux ",
"/casper/vmlinuz ",
"--- ",
"autoinstall ", "autoinstall ",
"ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-22/\"", "ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/\"",
"<leftCtrlOn>x<leftCtrlOff><wait>" "<leftCtrlOn>x<leftCtrlOff><wait>"
] ]
@ -43,6 +41,7 @@ source "proxmox-iso" "ubuntu-22" {
disk_size = "30G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"
type = "scsi" type = "scsi"
format = "qcow2"
} }
network_adapters { network_adapters {
bridge = "vmbr0" bridge = "vmbr0"
@ -54,12 +53,16 @@ source "proxmox-iso" "ubuntu-22" {
username = "${var.proxmox_apiuser}" username = "${var.proxmox_apiuser}"
password = "${var.proxmox_apitoken}" password = "${var.proxmox_apitoken}"
node = "kamino" node = "kamino"
pool = "Templates"
iso_url = "https://releases.ubuntu.com/22.04.4/ubuntu-22.04.4-live-server-amd64.iso" boot_iso {
iso_checksum = "sha256:45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2" type = "scsi"
iso_storage_pool = "iso" iso_url = "https://releases.ubuntu.com/22.04.5/ubuntu-22.04.5-live-server-amd64.iso"
unmount_iso = true iso_checksum = "sha256:9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0"
iso_download_pve = true iso_download_pve = true
iso_storage_pool = "iso"
unmount = true
}
ssh_username = "xadmin" ssh_username = "xadmin"
ssh_password = "packer" ssh_password = "packer"
@ -68,4 +71,16 @@ source "proxmox-iso" "ubuntu-22" {
build { build {
sources = ["source.proxmox-iso.ubuntu-22"] 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

@ -40,6 +40,7 @@ reboot --eject
%packages %packages
@base @base
@core @core
bash
nfs-utils nfs-utils
sudo sudo
@ -53,7 +54,7 @@ dnf -y install epel-release
dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent
usermod -aG wheel xadmin echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/xadmin
systemctl enable qemu-guest-agent systemctl enable qemu-guest-agent

View File

@ -135,6 +135,7 @@ tasksel tasksel/first multiselect standard
# Individual additional packages to install # Individual additional packages to install
d-i pkgsel/include string \ d-i pkgsel/include string \
apt-transport-https \ apt-transport-https \
bash \
curl \ curl \
dnsutils \ dnsutils \
openssh-server \ openssh-server \
@ -158,4 +159,5 @@ d-i finish-install/reboot_in_progress note
#d-i preseed/early_command string anna-install some-udeb #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. # 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 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 usermod -aG sudo xadmin; in-target systemctl enable qemu-guest-agent d-i preseed/late_command string in-target systemctl enable qemu-guest-agent; \
echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/xadmin;

View File

@ -1,4 +1,4 @@
url --url="https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/" url --url="https://dl.rockylinux.org/pub/rocky/$releasever/BaseOS/$basearch/os/"
# Keyboard layouts # Keyboard layouts
keyboard --vckeymap=us --xlayouts='us' keyboard --vckeymap=us --xlayouts='us'
@ -40,6 +40,7 @@ reboot --eject
%packages %packages
@base @base
@core @core
bash
nfs-utils nfs-utils
sudo sudo
@ -53,7 +54,7 @@ dnf -y install epel-release
dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent
usermod -aG wheel xadmin echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/xadmin
systemctl enable qemu-guest-agent systemctl enable qemu-guest-agent

View File

@ -34,11 +34,12 @@ autoinstall:
authorized-keys: [] authorized-keys: []
install-server: true install-server: true
packages:
- "qemu-guest-agent"
late-commands: late-commands:
- "echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/xadmin" - "echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/xadmin"
- "chmod 440 /target/etc/sudoers.d/xadmin" - "chmod 440 /target/etc/sudoers.d/xadmin"
- "curtin in-target --target=/target -- apt install -y qemu-guest-agent"
bootcmd: - "curtin in-target --target=/target -- systemctl enable qemu-guest-agent"
- "apt install -y qemu-guest-agent" - "curtin in-target --target=/target -- systemctl start qemu-guest-agent"
- "systemctl enable qemu-guest-agent"
- "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