Pārlūkot izejas kodu

Add more info in log messages and some more logging

pull/16/head
Kristijan Mitrovic pirms 4 gadiem
vecāks
revīzija
e3f7ff97c2
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. +4
    -2
      automation/roles/bubble/files/bubble_restore_monitor.sh

+ 4
- 2
automation/roles/bubble/files/bubble_restore_monitor.sh Parādīt failu

@@ -21,7 +21,7 @@ function die {
}

function log {
echo "${1}" >> ${LOG}
echo "[$(date)] ${1}" >> ${LOG}
}

START=$(date +%s)
@@ -107,6 +107,7 @@ log "Flushing redis"
echo "FLUSHALL" | redis-cli || die "Error flushing redis"

# restore algo configs
log "Restoring algo configs"
CONFIGS_BACKUP=/home/bubble/.BUBBLE_ALGO_CONFIGS.tgz
if [[ ! -f ${CONFIGS_BACKUP} ]] ; then
log "Warning: Algo VPN configs backup not found: ${CONFIGS_BACKUP}, not installing algo"
@@ -124,7 +125,8 @@ else

cd "${ANSIBLE_DIR}" && \
. ./venv/bin/activate && \
bash -c "ansible-playbook ${SSH_OPTIONS} --tags 'post_restore,always' --inventory ./hosts ./playbook.yml" \
bash -c \
"ansible-playbook ${SSH_OPTIONS} --tags 'post_restore,always' --inventory ./hosts ./playbook.yml 2>&1 >> ${LOG}" \
|| die "Error running ansible in post-restore. journalctl -xe = $(journalctl -xe | tail -n 50)"
fi



Notiek ielāde…
Atcelt
Saglabāt