Compare commits

..

No commits in common. "03ba17d8af41e001965fcf0e7e3ff6f2b1d966f4" and "eae24e3affb5d0fd2f3f89d2abd1b30b3023bb90" have entirely different histories.

6 changed files with 5 additions and 108 deletions

View File

@ -101,5 +101,4 @@ all: minimal $(APP_CTs)
#----------------------------------------------------------------------

View File

@ -76,9 +76,6 @@ sudo apt install git make
Note their numbers (i.e. the number in `vmbr#`), this will be needed for
setup.
Note, if the device has more that two ports it is recommended to assign
first/last ports to wan/admin respectively and clearly mark them as such.
### DNS
@ -96,14 +93,6 @@ For Proxmox firewall configuration see:
https://pve.proxmox.com/wiki/Firewall
### Recovery strategies
ns/gate as separate nodes for redundancy
ssh facing lan to avoid a single point of failure with gate
## Setup
```shell

View File

@ -86,21 +86,14 @@ DFL_PCT_EXTRA=SKIP
# Nameserver
NS_HOSTNAME=ns
NS_ID=100
NS_ADMIN_IP=10.0.0.1/24
NS_LAN_IP=10.1.1.1/24
RESERVE_NS_ID=101
TEMPLATE_NS_ID=200
# Gateway / Reverse proxy
GATE_HOSTNAME=gate
GATE_ID=110
GATE_ADMIN_IP=10.0.0.2/24
GATE_LAN_IP=10.1.1.2/24
RESERVE_GATE_ID=111
TEMPLATE_GATE_ID=210
#------------------------------------------------------------------------

View File

@ -17,8 +17,9 @@ readConfig
#----------------------------------------------------------------------
DFL_ID=${GATE_ID:=${DFL_ID:-102}}
DFL_CTHOSTNAME=${GATE_HOSTNAME:-${DFL_CTHOSTNAME:-gate}}
DFL_ID=${DFL_ID:=101}
# XXX revise...
DFL_CTHOSTNAME=${GATE_HOSTNAME:=${DFL_CTHOSTNAME:=gate}}
CORES=1
RAM=128

View File

@ -17,8 +17,8 @@ readConfig
#----------------------------------------------------------------------
DFL_ID=${NS_ID:=${DFL_ID:-100}}
DFL_CTHOSTNAME=${NS_HOSTNAME:-${DFL_CTHOSTNAME:-ns}}
DFL_ID=${DFL_ID:=100}
DFL_CTHOSTNAME=${NS_HOSTNAME:=${DFL_CTHOSTNAME:=ns}}
CORES=1
RAM=128

View File

@ -1,85 +0,0 @@
#!/usr/bin/bash
#----------------------------------------------------------------------
cd $(dirname $0)
PATH=$PATH:$(dirname "$(pwd)")
#----------------------------------------------------------------------
source ../.pct-helpers
#----------------------------------------------------------------------
CT_PATH=/etc/pve/lxc/
readConfig
#----------------------------------------------------------------------
makeReserveCT(){
local ID=$1
local RESERVE_ID=$2
local TEMPLATE_ID=$3
local HOSTNAME=$(ct2hostname $ID)
@ pct shutdown $ID
@ pct destroy $RESERVE_ID --purge
@ pct clone $ID $RESERVE_ID --hostname ${HOSTNAME}
@ pct start $ID
if [ $TEMPLATE_ID ] ; then
@ pct destroy $TEMPLATE_ID --purge
@ pct clone $RESERVE_ID $TEMPLATE_ID --hostname ${HOSTNAME}
@ pct templates $TEMPLATE_ID
fi
# XXX sould this get into the template...
@ pct set $RESERVE_ID -onboot 0
}
startReserveCT(){
local ID=$1
local RESERVE_ID=$2
local TEMPLATE_ID=$3
local HOSTNAME=$(ct2hostname $ID)
@ pct shutdown $ID
@ pct set $ID -onboot 0
# XXX check if a reserve is already up then recreate it from template...
@ pct start $RESERVE_ID
@ pct set $RESERVE_ID -onboot 1
}
#----------------------------------------------------------------------
xread "Gate ID:" GATE_ID
xread "Gate reserve ID:" RESERVE_GATE_ID
xread "Gate template ID:" TEMPLATE_GATE_ID
xread "NS ID:" NS_ID
xread "NS reserve ID:" RESERVE_NS_ID
xread "NS template ID:" TEMPLATE_NS_ID
#----------------------------------------------------------------------
makeReserveCT $GATE_ID $RESERVE_GATE_ID $TEMPLATE_GATE_ID
makeReserveCT $NS_ID $RESERVE_NS_ID $TEMPLATE_NS_ID
saveLastRunConfig
echo "# Done."
#----------------------------------------------------------------------
# vim:set ts=4 sw=4 :