1
1
Fork 1
This commit is contained in:
Derek Smith 2023-12-19 09:53:01 -05:00
parent 0c6e00deb2
commit 6fef36096e
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
3 changed files with 14 additions and 16 deletions

View File

@ -13,6 +13,7 @@ export INCUS_CONFIG_PATH="$SS_ROOT_PATH/incus"
export SS_CACHE_PATH="$SS_ROOT_PATH/cache"
export REMOTE_HOME="/home/ubuntu"
export REMOTE_DATA_PATH="$REMOTE_HOME/ss-data"
export REMOTE_DATA_PATH_LETSENCRYPT="$REMOTE_DATA_PATH/letsencrypt"

View File

@ -10,7 +10,7 @@ if incus remote get-default -q | grep -q "local"; then
exit 1
fi
KEEP_DOCKER_VOLUME=true
KEEP_ZFS_STORAGE_VOLUMES=true
OTHER_SITES_LIST=
SKIP_BTCPAY_SERVER=false
SKIP_WWW_SERVER=false
@ -25,7 +25,7 @@ LNPLAY_SERVER_MAC_ADDRESS=
for i in "$@"; do
case $i in
--purge)
KEEP_DOCKER_VOLUME=false
KEEP_ZFS_STORAGE_VOLUMES=false
shift
;;
--skip-btcpayserver)
@ -62,13 +62,16 @@ source ./project/domain_env.sh
source ./domain_list.sh
SERVERS=
if [ "$SKIP_BTCPAY_SERVER" = false ] && [ -n "$WWW_SERVER_MAC_ADDRESS" ]; then
SERVERS="btcpayserver"
if [ "$SKIP_WWW_SERVER" = false ] && [ -n "$WWW_SERVER_MAC_ADDRESS" ]; then
SERVERS="www $SERVERS"
fi
if [ "$SKIP_WWW_SERVER" = false ] && [ -n "$BTCPAY_SERVER_MAC_ADDRESS" ]; then
SERVERS="www $SERVERS"
if [ "$SKIP_BTCPAY_SERVER" = false ] && [ -n "$BTCPAY_SERVER_MAC_ADDRESS" ]; then
SERVERS="btcpayserver"
fi
if [ "$SKIP_LNPLAY_SERVER" = false ] && [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
@ -76,6 +79,7 @@ if [ "$SKIP_LNPLAY_SERVER" = false ] && [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ]; the
fi
for VIRTUAL_MACHINE in $SERVERS; do
INCUS_VM_NAME="$VIRTUAL_MACHINE-${PRIMARY_DOMAIN//./-}"
@ -95,8 +99,7 @@ for VIRTUAL_MACHINE in $SERVERS; do
incus profile delete "$INCUS_VM_NAME"
fi
if [ "$KEEP_DOCKER_VOLUME" = false ]; then
if [ "$KEEP_ZFS_STORAGE_VOLUMES" = false ]; then
# d for docker; b for backup; s for ss-data
for DATA in docker backup ss-data; do
VOLUME_NAME="$VIRTUAL_MACHINE-$DATA"
@ -109,10 +112,6 @@ for VIRTUAL_MACHINE in $SERVERS; do
fi
fi
done
else
# we maintain the volumes
# TODO make a snapshot on all the zfs storage volumes.
echo "TODO: create snapshot of ZFS volumes and pull them to mgmt machine."
fi
done

View File

@ -196,6 +196,8 @@ profiles:
name: default
EOF
ssh ubuntu@"$FQDN" incus project list -q >> /dev/null
# ensure the incus service is available over the network, then add a incus remote, then switch the active remote to it.
if wait-for-it -t 20 "$FQDN:8443"; then
# before we add the remote, we need a trust token from the incus server
@ -234,8 +236,4 @@ if ! incus storage list --format csv | grep -q ss-base; then
# done
# done
else
echo "WARNING! The host '$FQDN' appears to have Sovereign Stack worksloads already provisioned."
echo "INFO: Here are your current Deployments."
incus project list -q
fi