From 3cfc950335238fac72e224765f76dcdcdd841ffc Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 26 Nov 2021 22:05:50 +0000 Subject: [PATCH] Add lantern stage/task_begin/end directives to make output pretty --- src/run.sh | 35 ++++++++++++++++++- .../50-avahi-daemon.sh} | 0 2 files changed, 34 insertions(+), 1 deletion(-) rename src/{steps-preinstall/50-avahi-daemon.job => steps-config/50-avahi-daemon.sh} (100%) diff --git a/src/run.sh b/src/run.sh index 8ef6edc..39fa722 100644 --- a/src/run.sh +++ b/src/run.sh @@ -93,6 +93,7 @@ task_begin "Setting initial state"; cat apt-packages.txt >"${temp_dir}/apt-packages.txt"; queue_preinstall_step "10-apt-update.sh"; +queue_preinstall_step "15-ufw.sh"; queue_postinstall_step "100-ssh-cluster-config.sh"; task_end "$?"; @@ -109,6 +110,8 @@ step_current="1"; stage_begin "Configuring software choices"; +# TODO: hostname + if ask_yesno "Use apt cache?"; then source ./steps-config/10-apt-cache.sh; fi @@ -117,6 +120,13 @@ if ask_yesno "Install Docker?"; then source ./steps-config/10-docker.sh; fi + +### +# Autonomous config tasks +### + +source ./steps-config/50-avahi-daemon.sh + stage_end "$?"; ############################################################################### @@ -125,10 +135,12 @@ stage_end "$?"; # Pre-install tasks ### +stage_begin "Executing pre-install tasks"; while read -r preinstall_step; do #shellcheck disable=SC1090 source "steps-preinstall/${preinstall_step}"; done < <(cat "${temp_dir}/steps-preinstall.txt"); +stage_end "$?" "1 or more pre-install tasks failed"; ############################################################################### @@ -136,7 +148,9 @@ done < <(cat "${temp_dir}/steps-preinstall.txt"); # Install packages ### -apt-get install "$(cat "${temp_dir}/apt-packages.txt")"; +stage_begin "Installing apt packages"; +apt-get install --no-install-recommends --yes "$(cat "${temp_dir}/apt-packages.txt")"; +stage_end "$?" "Failed to install apt packages"; ############################################################################### @@ -144,10 +158,12 @@ apt-get install "$(cat "${temp_dir}/apt-packages.txt")"; # Post-install tasks ### +stage_begin "Running post-install tasks"; while read -r postinstall_step; do #shellcheck disable=SC1090 source "steps-postinstall/${postinstall_step}"; done < <(cat "${temp_dir}/steps-postinstall.txt"); +stage_begin "$?" "Failed to run 1 or more post-install tasks"; ############################################################################### @@ -156,3 +172,20 @@ done < <(cat "${temp_dir}/steps-postinstall.txt"); ### source "steps-last/15-ufw.sh"; + + +echo " +██████ ██████ ██████ ██ ██ ██ ███████ ██ ██████ ███ ██ ██ ███ ██ ██████ +██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ████ ██ ██ +██████ ██████ ██ ██ ██ ██ ██ ███████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ +██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +██ ██ ██ ██████ ████ ██ ███████ ██ ██████ ██ ████ ██ ██ ████ ██████ + + ██████ ██████ ███ ███ ██████ ██ ███████ ████████ ███████ ██ +██ ██ ██ ████ ████ ██ ██ ██ ██ ██ ██ ██ +██ ██ ██ ██ ████ ██ ██████ ██ █████ ██ █████ ██ +██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██████ ██████ ██ ██ ██ ███████ ███████ ██ ███████ ██ + +This host is now ready for use. +"; diff --git a/src/steps-preinstall/50-avahi-daemon.job b/src/steps-config/50-avahi-daemon.sh similarity index 100% rename from src/steps-preinstall/50-avahi-daemon.job rename to src/steps-config/50-avahi-daemon.sh