Compare commits
31 Commits
4e00aa8ba7
...
main
Author | SHA1 | Date | |
---|---|---|---|
1e9c3f461d | |||
87b7a3b8ab | |||
b7318e1549 | |||
46a8616ba4 | |||
2fcb082ccd | |||
c490db3cb0 | |||
e214d7b092 | |||
97209dee64 | |||
8167cb6554 | |||
fee73891e8 | |||
6e08664e14 | |||
caab68a92d | |||
ea20c5848c | |||
75ab6d02da | |||
2cf2f865e6 | |||
e94b05112b | |||
d2ac6c777d | |||
55cfdb03bf | |||
6588979f8a | |||
5013fa83cc | |||
18e0214a21 | |||
5a27129508 | |||
3b10d7ee0f | |||
2a1d0b520f | |||
d8fea80ded | |||
060c35058d | |||
e342cea6ef | |||
1a47889679 | |||
de5e7d31fd | |||
ae110e4fda | |||
f438cb7c92 |
@ -10,7 +10,7 @@ variable "proxmox_apitoken" {
|
||||
|
||||
source "proxmox-iso" "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_key_interval = "200ms"
|
||||
@ -30,6 +30,7 @@ source "proxmox-iso" "almalinux-9" {
|
||||
disk_size = "30G"
|
||||
storage_pool = "templates"
|
||||
type = "scsi"
|
||||
format = "qcow2"
|
||||
}
|
||||
network_adapters {
|
||||
bridge = "vmbr0"
|
||||
@ -40,14 +41,17 @@ source "proxmox-iso" "almalinux-9" {
|
||||
insecure_skip_tls_verify = true
|
||||
username = "${var.proxmox_apiuser}"
|
||||
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"
|
||||
iso_checksum = "sha256:af5377a1d16bbe599ea91a8761ad645f2f54687075802bdc0c0703ee610182e9"
|
||||
iso_storage_pool = "iso"
|
||||
unmount_iso = true
|
||||
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"
|
||||
@ -58,6 +62,11 @@ build {
|
||||
sources = ["source.proxmox-iso.almalinux-9"]
|
||||
|
||||
provisioner "shell" {
|
||||
script = "scripts/rhel-setup.sh"
|
||||
script = "scripts/rhel-install.sh"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
source = "scripts/initial-setup.sh"
|
||||
destination = "/home/xadmin/initial-setup.sh"
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ variable "proxmox_apitoken" {
|
||||
|
||||
source "proxmox-iso" "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_key_interval = "200ms"
|
||||
@ -30,6 +30,7 @@ source "proxmox-iso" "debian-12" {
|
||||
disk_size = "30G"
|
||||
storage_pool = "templates"
|
||||
type = "scsi"
|
||||
format = "qcow2"
|
||||
}
|
||||
network_adapters {
|
||||
bridge = "vmbr0"
|
||||
@ -40,14 +41,17 @@ source "proxmox-iso" "debian-12" {
|
||||
insecure_skip_tls_verify = true
|
||||
username = "${var.proxmox_apiuser}"
|
||||
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"
|
||||
iso_checksum = "sha256:013f5b44670d81280b5b1bc02455842b250df2f0c6763398feb69af1a805a14f"
|
||||
iso_storage_pool = "iso"
|
||||
unmount_iso = 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"
|
||||
@ -58,6 +62,11 @@ build {
|
||||
sources = ["source.proxmox-iso.debian-12"]
|
||||
|
||||
provisioner "shell" {
|
||||
script = "scripts/debian-setup.sh"
|
||||
script = "scripts/debian-install.sh"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
source = "scripts/initial-setup.sh"
|
||||
destination = "/home/xadmin/initial-setup.sh"
|
||||
}
|
||||
}
|
@ -1,59 +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()}"
|
||||
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><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 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>"]
|
||||
|
||||
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"
|
||||
pool = "Templates"
|
||||
|
||||
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"]
|
||||
|
||||
provisioner "shell" {
|
||||
script = "scripts/freebsd-setup.sh"
|
||||
}
|
||||
}
|
68
FreeBSD/freebsd-14.pkr.hcl
Normal file
68
FreeBSD/freebsd-14.pkr.hcl
Normal 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"
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ variable "proxmox_apitoken" {
|
||||
|
||||
source "proxmox-iso" "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_key_interval = "200ms"
|
||||
@ -30,6 +30,7 @@ source "proxmox-iso" "rocky-9" {
|
||||
disk_size = "30G"
|
||||
storage_pool = "templates"
|
||||
type = "scsi"
|
||||
format = "qcow2"
|
||||
}
|
||||
network_adapters {
|
||||
bridge = "vmbr0"
|
||||
@ -40,14 +41,17 @@ source "proxmox-iso" "rocky-9" {
|
||||
insecure_skip_tls_verify = true
|
||||
username = "${var.proxmox_apiuser}"
|
||||
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"
|
||||
iso_checksum = "sha256:eb096f0518e310f722d5ebd4c69f0322df4fc152c6189f93c5c797dc25f3d2e1"
|
||||
iso_storage_pool = "iso"
|
||||
unmount_iso = true
|
||||
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"
|
||||
@ -58,6 +62,11 @@ build {
|
||||
sources = ["source.proxmox-iso.rocky-9"]
|
||||
|
||||
provisioner "shell" {
|
||||
script = "scripts/rhel-setup.sh"
|
||||
script = "scripts/rhel-install.sh"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
source = "scripts/initial-setup.sh"
|
||||
destination = "/home/xadmin/initial-setup.sh"
|
||||
}
|
||||
}
|
@ -21,12 +21,9 @@ source "proxmox-iso" "ubuntu-22" {
|
||||
# Go to the end of the boot command
|
||||
"<down><down><down><down><left> <wait>",
|
||||
|
||||
# Add kernel command-line and start install
|
||||
"linux ",
|
||||
"/casper/vmlinuz ",
|
||||
"--- ",
|
||||
# Add kernel command-line to start autoinstall
|
||||
"autoinstall ",
|
||||
"ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-22/\"",
|
||||
"ds=\"nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/\"",
|
||||
"<leftCtrlOn>x<leftCtrlOff><wait>"
|
||||
]
|
||||
|
||||
@ -44,6 +41,7 @@ source "proxmox-iso" "ubuntu-22" {
|
||||
disk_size = "30G"
|
||||
storage_pool = "templates"
|
||||
type = "scsi"
|
||||
format = "qcow2"
|
||||
}
|
||||
network_adapters {
|
||||
bridge = "vmbr0"
|
||||
@ -54,14 +52,17 @@ source "proxmox-iso" "ubuntu-22" {
|
||||
insecure_skip_tls_verify = true
|
||||
username = "${var.proxmox_apiuser}"
|
||||
password = "${var.proxmox_apitoken}"
|
||||
node = "geonosis"
|
||||
node = "kamino"
|
||||
pool = "Templates"
|
||||
|
||||
iso_url = "https://releases.ubuntu.com/22.04.4/ubuntu-22.04.4-live-server-amd64.iso"
|
||||
iso_checksum = "sha256:45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2"
|
||||
iso_storage_pool = "iso"
|
||||
unmount_iso = 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"
|
||||
@ -72,6 +73,14 @@ build {
|
||||
sources = ["source.proxmox-iso.ubuntu-22"]
|
||||
|
||||
provisioner "shell" {
|
||||
script = "scripts/debian-setup.sh"
|
||||
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
86
Ubuntu/ubuntu-24.pkr.hcl
Normal 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"
|
||||
}
|
||||
}
|
@ -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 --vckeymap=us --xlayouts='us'
|
||||
|
@ -1,9 +1,8 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
name = {
|
||||
version = "~> 1"
|
||||
version = "1.2.1"
|
||||
source = "github.com/hashicorp/proxmox"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,4 +6,3 @@ sudo apt upgrade -y
|
||||
|
||||
sudo apt install -y vim
|
||||
|
||||
wget -O - https://bootstrap.saltstack.com | sudo sh
|
17
scripts/freebsd-install.sh
Normal file
17
scripts/freebsd-install.sh
Normal 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
|
||||
|
@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# FreeBSD steps
|
||||
sudo pkg update
|
||||
sudo pkg upgrade -y
|
||||
|
||||
sudo pkg install -y vim py39-salt
|
35
scripts/initial-setup.sh
Normal file
35
scripts/initial-setup.sh
Normal 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
6
scripts/remove-snap.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
sudo apt purge -y snapd
|
||||
|
||||
sudo rm -rf /var/lib/snap
|
||||
sudo rm -rf /root/snap
|
@ -4,4 +4,3 @@ sudo dnf update -y
|
||||
|
||||
sudo dnf install -y vim
|
||||
|
||||
wget -O - https://bootstrap.saltstack.com | sudo sh
|
Reference in New Issue
Block a user