-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdevbox
More file actions
executable file
·44 lines (35 loc) · 808 Bytes
/
devbox
File metadata and controls
executable file
·44 lines (35 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
if ! which ansible-playbook > /dev/null 2>&1; then
echo "Could not find ansible. Please install ansible first"
exit 1
fi
BASEDIR=$(dirname "$0")
if [ ! -f "${BASEDIR}/vars.yml" ]; then
echo -n "mail: "
read MAIL
echo -n "displayName: "
read DISPLAY_NAME
echo -n "gpg key (KeyId): "
read GPG_KEY
cat > "${BASEDIR}/vars.yml" <<EOF
mail: ${MAIL}
displayName: ${DISPLAY_NAME}
gpgKey: "${GPG_KEY}"
EOF
fi
if which python3 > /dev/null 2>&1; then
PYTHON=$(which python3)
else
PYTHON=$(which python)
fi
echo "starting ansible ..."
echo "===================="
ansible-playbook \
-e ansible_python_interpreter="${PYTHON}" \
--extra-vars="@${BASEDIR}/vars.yml" \
"${BASEDIR}/playbook.yml" \
--connection local \
-i localhost, \
-K $@