feat: añadido archivos básicos para crear el template y los equipos en proxmox

This commit is contained in:
Javier Niño Sánchez
2026-10-25 20:02:54 +01:00
parent a02ff5c4bc
commit 2f17d7b03d
8 changed files with 501 additions and 1 deletions

39
common.sh Normal file
View File

@@ -0,0 +1,39 @@
# shellcheck shell=bash disable=SC2034
# Ajustes y funciones comunes a los scripts que se ejecutan en el host Proxmox.
# No se ejecuta: cada script lo carga con source.
TEMPLATE_ID=900
PROXY_ID=199
CT_ID_BASE=100 # equipo n -> CT 100+n
CT_COUNT=15
SUBNET=10.10.10 # IP del CT de equipo = SUBNET.<id del CT>
PROXY_INT_IP=10.10.10.1
INT_BRIDGE=vmbr1
CT_CPULIMIT=0.5
CT_MEMORY_MB=512
CT_PIDS_MAX=256
CT_RATE_MBYTES=6.25 # PVE limita en MB/s: 6.25 = 50 Mbit/s
DOMAIN=taller.example.org
TTYD_PORT=7681
EXT_BRIDGE=vmbr0 # bridge con internet; solo para construir la plantilla
CT_STORAGE=tank # almacenamiento ZFS para los discos de los CT
CT_DISK_GB=4
IMAGE_STORAGE=local # almacenamiento de la imagen de Debian descargada
TTYD_VERSION=1.7.7 # binario estático oficial: Debian 13 no empaqueta ttyd
TTYD_SHA256=8a217c968aba172e0dbf3f34447218dc015bc4d5e59bf51db2f2cd12b7be4f55
die() {
echo "error: $*" >&2
exit 1
}
# Repite un comando cada segundo hasta que funcione, como mucho <tries> veces
wait_for() {
local tries=$1
shift
until "$@"; do
(( --tries > 0 )) || return 1
sleep 1
done
}