diff --git a/deploy.sh b/deploy.sh index bd72edc..2288ea6 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,12 +2,25 @@ set -eu +UPDATE=true +if [ $# -eq 1 ] && [ "$1" = "-n" ]; then + UPDATE=false + shift +fi + +if [ $# -gt 0 ]; then + echo "Usage: $(basename "$0") [-n]" 1>&2 + exit 1 +fi + # run sudo to cache creds sudo /bin/true # update modules and check depencies git pull -git submodule update --init --recursive +if "$UPDATE" || [ ! -f roles/.git ]; then + git submodule update --init --recursive +fi if ! rpm -q ansible > /dev/null; then sudo dnf -y install ansible fi