diff --git a/deployment/deployment_defaults.sh b/deployment/deployment_defaults.sh index b72147a..4cf6e3b 100755 --- a/deployment/deployment_defaults.sh +++ b/deployment/deployment_defaults.sh @@ -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" diff --git a/deployment/down.sh b/deployment/down.sh index c7b2a67..a891e62 100755 --- a/deployment/down.sh +++ b/deployment/down.sh @@ -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 diff --git a/deployment/remote.sh b/deployment/remote.sh index 603641c..a81cfde 100755 --- a/deployment/remote.sh +++ b/deployment/remote.sh @@ -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