Make updating roles optional to help development

This commit is contained in:
Timo Makinen 2021-09-30 17:24:12 +00:00
parent 8a23b2bb19
commit 674372ad74

View file

@ -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