diff --git a/bubble-server/src/main/resources/ansible/roles/algo/templates/install_algo.sh.j2 b/bubble-server/src/main/resources/ansible/roles/algo/templates/install_algo.sh.j2 index 5fc54c13..72ecabfd 100644 --- a/bubble-server/src/main/resources/ansible/roles/algo/templates/install_algo.sh.j2 +++ b/bubble-server/src/main/resources/ansible/roles/algo/templates/install_algo.sh.j2 @@ -13,6 +13,10 @@ cd ${ALGO_BASE} if [[ ! -f "${ALGO_BASE}/config.cfg.hbs" ]] ; then die "No ${ALGO_BASE}/config.cfg.hbs found" fi +if [[ -f "${ALGO_BASE}/.install_marker" ]] ; then + echo "Algo already installed" + exit 0 +fi java -cp /home/bubble/api/bubble.jar bubble.main.BubbleMain generate-algo-conf --algo-config ${ALGO_BASE}/config.cfg.hbs || die "Error writing algo config.cfg" @@ -38,3 +42,5 @@ python3 -m virtualenv --python="$(command -v python3)" .env \ CONFIGS_BACKUP=/home/bubble/.BUBBLE_ALGO_CONFIGS.tgz cd ${ALGO_BASE} && tar czf ${CONFIGS_BACKUP} configs && chgrp bubble ${CONFIGS_BACKUP} && chmod 660 ${CONFIGS_BACKUP} || die "Error backing up algo configs" cd /home/bubble && tar xzf ${CONFIGS_BACKUP} && chgrp -R bubble configs && chown -R bubble configs && chmod 500 configs || die "Error unpacking algo configs to bubble home" + +touch "${ALGO_BASE}/.install_marker"