diff --git a/setup/so-functions b/setup/so-functions index 4f9d4938e..54add4e1b 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -21,6 +21,40 @@ source ./so-common-functions SOVERSION=$(cat ../VERSION) +log() { + msg=$1 + level=${2:-I} + now=$(TZ=GMT date +"%Y-%m-%dT%H:%M:%SZ") + echo -e "$now | $level | $msg" >> "$setup_log" 2>&1 +} + +error() { + log "$1" "E" +} + +info() { + log "$1" "I" +} + +header() { + echo -e "-----------------------------\n $1\n-----------------------------\n" >> "$setup_log" 2>&1 +} + +logCmd() { + cmd=$1 + info "Executing command: $cmd\n$($cmd)\n" +} + +analyze_system() { + header "System Characteristics" + logCmd "uptime" + logCmd "uname -a" + logCmd "free -h" + logCmd "lscpu" + logCmd "df -h" + logCmd "ip a" +} + accept_salt_key_remote() { systemctl restart salt-minion diff --git a/setup/so-setup b/setup/so-setup index c933abcce..22936fbb8 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -48,9 +48,11 @@ done # Begin Installation pre-processing parse_install_username -echo "Installing as the $INSTALLUSERNAME user." >> $setup_log 2>&1 -echo "---- Starting setup at $(date -u) ----" >> $setup_log 2>&1 +header "Initializing Setup" +info "Installing as the $INSTALLUSERNAME user" + +analyze_system automated=no function progress() { @@ -76,9 +78,6 @@ if [[ -f automation/$automation && $(basename $automation) == $automation ]]; th source automation/$automation automated=yes - echo "Checking network configuration" >> $setup_log 2>&1 - ip a >> $setup_log 2>&1 - attempt=1 attempts=60 ip a | grep "$MNIC:" | grep "state UP" >> $setup_log 2>&1