Standardized hardware config on templates to use better CPU and disk types; Updated Ubuntu 22, Rocky 9 and Almalinux 9 post-install stuff

This commit is contained in:
Gregory Ballantine 2024-04-20 22:05:11 -04:00
parent 86b8e70740
commit cb410f3dc5
9 changed files with 42 additions and 46 deletions

View File

@ -22,7 +22,9 @@ source "proxmox-iso" "almalinux-9" {
os = "l26" os = "l26"
cores = "2" cores = "2"
sockets = "1" sockets = "1"
cpu_type = "host"
memory = "2048" memory = "2048"
scsi_controller = "virtio-scsi-single"
disks { disks {
disk_size = "30G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"

View File

@ -22,9 +22,11 @@ source "proxmox-iso" "debian-12" {
os = "l26" os = "l26"
cores = "2" cores = "2"
sockets = "1" sockets = "1"
cpu_type = "host"
memory = "2048" memory = "2048"
scsi_controller = "virtio-scsi-single"
disks { disks {
disk_size = "10G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"
type = "scsi" type = "scsi"
} }

View File

@ -18,9 +18,11 @@ source "proxmox-iso" "freebsd-14" {
os = "other" os = "other"
cores = "2" cores = "2"
sockets = "1" sockets = "1"
cpu_type = "host"
memory = "2048" memory = "2048"
scsi_controller = "virtio-scsi-single"
disks { disks {
disk_size = "10G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"
type = "scsi" type = "scsi"
} }

View File

@ -20,11 +20,11 @@ source "proxmox-iso" "rocky-9" {
http_port_min = "8080" http_port_min = "8080"
os = "l26" os = "l26"
machine = "pc"
scsi_controller = "virtio-scsi-single"
cores = "2" cores = "2"
sockets = "1" sockets = "1"
cpu_type = "host"
memory = "2048" memory = "2048"
scsi_controller = "virtio-scsi-single"
disks { disks {
disk_size = "30G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"
@ -39,7 +39,7 @@ 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 = "kamino" node = "geonosis"
iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.3-x86_64-boot.iso" iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.3-x86_64-boot.iso"
iso_checksum = "sha256:eb096f0518e310f722d5ebd4c69f0322df4fc152c6189f93c5c797dc25f3d2e1" iso_checksum = "sha256:eb096f0518e310f722d5ebd4c69f0322df4fc152c6189f93c5c797dc25f3d2e1"

View File

@ -18,23 +18,15 @@ source "proxmox-iso" "ubuntu-22" {
"e<wait>", "e<wait>",
# Go to the end of the boot command # Go to the end of the boot command
"<down><down><down><down><down><wait>", "<down><down><down><down><left> <wait>",
# Remove the kernel command-line that already exists
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs>",
# Add kernel command-line and start install # Add kernel command-line and start install
"linux ", "linux ",
"/casper/vmlinuz ", "/casper/vmlinuz ",
"--- ",
"autoinstall ", "autoinstall ",
"ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-22/ ", "ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-22/\"",
"<enter>" "<leftCtrlOn>x<leftCtrlOff><wait>"
] ]
http_directory = "http" http_directory = "http"
@ -42,11 +34,11 @@ source "proxmox-iso" "ubuntu-22" {
http_port_min = "8080" http_port_min = "8080"
os = "l26" os = "l26"
machine = "pc"
scsi_controller = "virtio-scsi-single"
cores = "2" cores = "2"
sockets = "1" sockets = "1"
cpu_type = "host"
memory = "2048" memory = "2048"
scsi_controller = "virtio-scsi-single"
disks { disks {
disk_size = "30G" disk_size = "30G"
storage_pool = "templates" storage_pool = "templates"

View File

@ -14,7 +14,7 @@ rootpw --iscrypted $6$kkuIkd8S9gDUhK8g$1XbqJDCjt1zQAhxb9sC2mE5CGd.D0xV1efu0R8h1e
authselect --useshadow --passalgo=sha512 authselect --useshadow --passalgo=sha512
# Create my initial user :D # Create my initial user :D
#user --disabled #user --disabled
user --name=xadmin --shell=/bin/bash --homedir=/home/xadmin --iscrypted --password=$6$y6lN/cfPPtlyaTXu$4QUYFl816sxWPuyR.eY6mCJ3ybYLNcF6Pw4ar4K7Dyy9LbedK3PjkTNZfWqSdoPRpJMjtrbpY1xQ.zDXxOTug. 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 network --device=eth0 --bootproto=dhcp --ipv6=auto --activate
@ -42,7 +42,6 @@ reboot --eject
@core @core
nfs-utils nfs-utils
sudo sudo
qemu-guest-agent
%end %end
@ -50,13 +49,12 @@ qemu-guest-agent
# Update the system # Update the system
yum -y update yum -y update
# Istall the EPEL repository # Istall the EPEL repository
yum -y install epel-release dnf -y install epel-release
yum -y install wget vim yum-plugin-versionlock dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent
usermod -aG wheel xadmin usermod -aG wheel xadmin
systemctl enable qemu-guest-agent systemctl enable qemu-guest-agent
%end %end

View File

@ -14,7 +14,7 @@ rootpw --iscrypted $6$kkuIkd8S9gDUhK8g$1XbqJDCjt1zQAhxb9sC2mE5CGd.D0xV1efu0R8h1e
authselect --useshadow --passalgo=sha512 authselect --useshadow --passalgo=sha512
# Create my initial user :D # Create my initial user :D
#user --disabled #user --disabled
user --name=xadmin --shell=/bin/bash --homedir=/home/xadmin --iscrypted --password=$6$y6lN/cfPPtlyaTXu$4QUYFl816sxWPuyR.eY6mCJ3ybYLNcF6Pw4ar4K7Dyy9LbedK3PjkTNZfWqSdoPRpJMjtrbpY1xQ.zDXxOTug. 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 network --device=eth0 --bootproto=dhcp --ipv6=auto --activate
@ -42,7 +42,6 @@ reboot --eject
@core @core
nfs-utils nfs-utils
sudo sudo
qemu-guest-agent
%end %end
@ -50,13 +49,12 @@ qemu-guest-agent
# Update the system # Update the system
yum -y update yum -y update
# Istall the EPEL repository # Istall the EPEL repository
yum -y install epel-release dnf -y install epel-release
yum -y install wget vim yum-plugin-versionlock dnf -y install wget vim yum-plugin-versionlock qemu-guest-agent
usermod -aG wheel xadmin usermod -aG wheel xadmin
systemctl enable qemu-guest-agent systemctl enable qemu-guest-agent
%end %end

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

View File

@ -1,24 +1,21 @@
#cloud-config #cloud-config
autoinstall: autoinstall:
version: 1 version: 1
early-commands: early-commands:
- systemctl stop ssh - systemctl stop ssh
locale: en_US.UTF-8 locale: en_US.UTF-8
keyboard: keyboard:
layout: us layout: us
network:
network:
version: 2
ethernets:
eth0:
dhcp4: yes
dhcp-identifier: mac
apt: apt:
geoip: true
preserve_sources_list: false preserve_sources_list: false
primary: primary:
- arches: [i386, amd64] - arches: [i386, amd64]
uri: "http://archive.ubuntu.com/ubuntu" uri: "http://archive.ubuntu.com/ubuntu"
geoip: true
storage: storage:
layout: layout:
name: lvm name: lvm
@ -28,15 +25,20 @@ autoinstall:
username: xadmin username: xadmin
password: $6$8DdxHyrH6HfGZhDs$jEadYAMi3CTJivYgGjhG7S2C/ChZxv0w0L6AQ3Egn8K5xIA4OEqDngVfozfn.9kYxy.hWYpzwBE0qwytcU4BF0 password: $6$8DdxHyrH6HfGZhDs$jEadYAMi3CTJivYgGjhG7S2C/ChZxv0w0L6AQ3Egn8K5xIA4OEqDngVfozfn.9kYxy.hWYpzwBE0qwytcU4BF0
user-data:
late-commands: disable_root: true
- "echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/xadmin" package_upgrade: true
- "chmod 440 /target/etc/sudoers.d/ubuntu"
- "apt install -y qemu-guest-agent"
- "systemctl enable qemu-guest-agent"
- "apt purge -y snapd"
ssh: ssh:
allow-pw: true allow-pw: true
authorized-keys: [] authorized-keys: []
install-server: true install-server: true
late-commands:
- "echo 'xadmin ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/xadmin"
- "chmod 440 /target/etc/sudoers.d/xadmin"
bootcmd:
- "apt install -y qemu-guest-agent"
- "systemctl enable qemu-guest-agent"
- "systemctl start qemu-guest-agent"