From 36fe3cbd1a6534193560fe3804efc7d7b1046d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?= Date: Thu, 7 Nov 2024 16:18:25 +0100 Subject: [PATCH] Scripted provisioning of VMs --- .gitignore | 1 + flake.lock | 8 +- provision-vm.sh | 223 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 228 insertions(+), 4 deletions(-) create mode 100755 provision-vm.sh diff --git a/.gitignore b/.gitignore index 394e5d7e..bb134c56 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ tmp/ *.iso result +.proxmox diff --git a/flake.lock b/flake.lock index 7bf15885..556c3019 100644 --- a/flake.lock +++ b/flake.lock @@ -147,11 +147,11 @@ "pixelfed": "pixelfed" }, "locked": { - "lastModified": 1730317447, - "narHash": "sha256-Y3AhMe9WsFrjVhbmlTUXJd9TKDa7rFHb9F5hdG2eiJQ=", + "lastModified": 1730977329, + "narHash": "sha256-1/txLla4VANl2g/oyf5ehG5QSGauO/yvOzrblqzJzN8=", "ref": "refs/heads/main", - "rev": "007c168081267ed72dfbcec967b24e6ffc16b4a4", - "revCount": 96, + "rev": "cd194f818df0f1752da4ef15c1e435586d28b596", + "revCount": 97, "type": "git", "url": "https://git.fediversity.eu/fediversity/simple-nixos-fediverse.git" }, diff --git a/provision-vm.sh b/provision-vm.sh new file mode 100755 index 00000000..38420f42 --- /dev/null +++ b/provision-vm.sh @@ -0,0 +1,223 @@ +#!/usr/bin/env sh +set -euC + +## Proxmox API doc: https://pve.proxmox.com/pve-docs/api-viewer + +################################################################################ +## Parse arguments + +username= +password= +iso=result/iso/installer.iso +sockets=1 +cores=1 +memory=2048 +vmid= + +help () { + cat <