Add an initial sudo role.
This commit is contained in:
25
ansible/run.bash
Executable file
25
ansible/run.bash
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Run ansible
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd "$DIR"
|
||||
|
||||
function die {
|
||||
code="$1"
|
||||
shift 1
|
||||
(>&2 echo "${@}")
|
||||
exit "$code"
|
||||
}
|
||||
|
||||
target="$1"
|
||||
shift 1
|
||||
|
||||
if [ "$target" = "homeserver" ]; then
|
||||
ansible-playbook -v -i environments/home playbook.yaml --diff --limit homeserver "${@}"
|
||||
elif [ "$target" = "dummy" ]; then
|
||||
echo "dummy"
|
||||
else
|
||||
die 1 "Unrecognized target"
|
||||
fi
|
||||
Reference in New Issue
Block a user