From ea0fc6e65aeb76020dfefc148823273015473d45 Mon Sep 17 00:00:00 2001 From: June <june@jsts.xyz> Date: Sun, 16 Feb 2025 23:33:36 +0100 Subject: [PATCH] make settings configurable via environment variables set externally --- README.md | 5 ++++- build-proxmox-template | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 21902ea..dbce297 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,10 @@ The script uses the package [`libguestfs-tools`](https://libguestfs.org)' `virt- ## Building the Template ### Configuration Options -Verify that the settings at the beginning of the script are suitable to the cluster you want to create the template from. + +The following settings are available for configuration by setting the respective environment variable. +Verify that the configured settings are suitable for the cluster you want to create the template for. +If left unset, the respective default value will be used. | Variable | Default | Description | | --------- | --------------------------------------- | ---------------------------------------------------------------------- | diff --git a/build-proxmox-template b/build-proxmox-template index db73021..c4263e5 100755 --- a/build-proxmox-template +++ b/build-proxmox-template @@ -5,11 +5,11 @@ # Needs apt install libguestfs-tools # -VMID=9023 -STORAGE=local-zfs -OS=debian-12 -NAME=chaos-${OS}-tmpl-$(date -u +%Y-%m-%d) -BRIDGE=vmbr0,tag=208 +: "${VMID:=9023}" +: "${STORAGE:=local-zfs}" +: "${OS:=debian-12}" +: "${NAME:=chaos-${OS}-tmpl-$(date -u +%Y-%m-%d)}" +: "${BRIDGE:=vmbr0,tag=208}" set -eE