initial working
This commit is contained in:
60
scripts/setup-config.sh
Executable file
60
scripts/setup-config.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
# setup-config.sh
|
||||
# Script interattivo per configurare il provisioning
|
||||
|
||||
echo "=== Configurazione Cluster HA ==="
|
||||
echo ""
|
||||
|
||||
# Leggi configurazione
|
||||
read -p "Nome nodo Proxmox [pve]: " PVE_NODE
|
||||
PVE_NODE=${PVE_NODE:-pve}
|
||||
|
||||
read -p "Storage per dischi VM [local-lvm]: " STORAGE
|
||||
STORAGE=${STORAGE:-local-lvm}
|
||||
|
||||
read -p "Bridge di rete [vmbr0]: " BRIDGE
|
||||
BRIDGE=${BRIDGE:-vmbr0}
|
||||
|
||||
read -p "IP VM1 [192.168.1.10]: " VM1_IP
|
||||
VM1_IP=${VM1_IP:-192.168.1.10}
|
||||
|
||||
read -p "IP VM2 [192.168.1.11]: " VM2_IP
|
||||
VM2_IP=${VM2_IP:-192.168.1.11}
|
||||
|
||||
read -p "Virtual IP [192.168.1.100]: " VIP
|
||||
VIP=${VIP:-192.168.1.100}
|
||||
|
||||
read -p "Gateway [192.168.1.1]: " GATEWAY
|
||||
GATEWAY=${GATEWAY:-192.168.1.1}
|
||||
|
||||
read -p "CPU cores per VM [4]: " CORES
|
||||
CORES=${CORES:-4}
|
||||
|
||||
read -p "RAM per VM in MB [8192]: " MEMORY
|
||||
MEMORY=${MEMORY:-8192}
|
||||
|
||||
read -p "Dimensione disco [50G]: " DISK_SIZE
|
||||
DISK_SIZE=${DISK_SIZE:-50G}
|
||||
|
||||
echo ""
|
||||
echo "Inserisci la tua chiave SSH pubblica:"
|
||||
read SSH_PUBLIC_KEY
|
||||
|
||||
# Salva configurazione
|
||||
cat > provision-config.env << EOF
|
||||
PVE_NODE="$PVE_NODE"
|
||||
STORAGE="$STORAGE"
|
||||
BRIDGE="$BRIDGE"
|
||||
VM1_IP="$VM1_IP"
|
||||
VM2_IP="$VM2_IP"
|
||||
VIP="$VIP"
|
||||
GATEWAY="$GATEWAY"
|
||||
CORES=$CORES
|
||||
MEMORY=$MEMORY
|
||||
DISK_SIZE="$DISK_SIZE"
|
||||
SSH_PUBLIC_KEY="$SSH_PUBLIC_KEY"
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
echo "✓ Configurazione salvata in provision-config.env"
|
||||
echo "Esegui: ./provision-ha-cluster.sh"
|
||||
Reference in New Issue
Block a user