From 86cfd83b2d1e346adf9c6abc9ea743e9b40cf105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Robotka?= <robotka.adrian@gmail.com> Date: Sun, 17 Jan 2021 21:51:23 +0100 Subject: [PATCH] adjust to new bootstrapper --- playbook-template/bootstrap.sh | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/playbook-template/bootstrap.sh b/playbook-template/bootstrap.sh index d13c8c9..77fe521 100755 --- a/playbook-template/bootstrap.sh +++ b/playbook-template/bootstrap.sh @@ -1,28 +1,8 @@ #!/usr/bin/env bash -########################### Config #################################### - -reporaw="https://git.sch.bme.hu/kszk/sysadmin/ansible/ansci/-/raw/master/playbook-template" - -########################### Methods #################################### - -download() { - local url="$1" - local dest="$2" - if command -v wget &>/dev/null; then - wget "$url" -O "$dest" - else - curl "$url" -O "$dest" - fi -} - -downloadFile() { - download "$reporaw/$1" "$1" -} - ########################### Virtualenv setup #################################### -downloadFile "requirements.python.txt" +echo ansible > requirements.python.txt # check existance of virtualenv command if ! command -v virtualenv &>/dev/null; then @@ -33,14 +13,16 @@ if ! command -v virtualenv &>/dev/null; then exit 1 fi -# create virtualenv if not present -[[ ! -d .venv ]] && virtualenv .venv +# if not in virtualenv +if [[ "$VIRTUAL_ENV" == "" ]]; then + # create virtualenv if not present + [[ ! -d .venv ]] && virtualenv .venv -source .venv/bin/activate -pip install -r requirements.python.txt + source .venv/bin/activate + pip install -r requirements.python.txt +fi ########################### Ansible setup #################################### - ansible-galaxy install -r requirements.galaxy.yml ########################### Help to ${dummies:Mike} #################################### -- GitLab