summaryrefslogtreecommitdiffstats
path: root/ansible/ansible.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/ansible.sh')
-rwxr-xr-xansible/ansible.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/ansible/ansible.sh b/ansible/ansible.sh
new file mode 100755
index 0000000..7d50833
--- /dev/null
+++ b/ansible/ansible.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+IMG=ansible:2.10-cytopia-plus
+SSH_ARGS=()
+
+#[[ -n "${SSH_AUTH_SOCK:-}" && -S "$SSH_AUTH_SOCK" ]] && SSH_ARGS=(-v "$SSH_AUTH_SOCK":/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent)
+
+
+
+cmd="$(basename "$0")"
+
+exec docker run --rm -it \
+ -u "$(id -u):$(id -g)" \
+ -v "/root/ands":/root/ands -w /root/ands \
+ -v "$HOME/.ssh":/root/.ssh:ro \
+ -v "$HOME/.ansible":/root/.ansible \
+ "${SSH_ARGS[@]}" \
+ "$IMG" "$cmd" "$@" \ No newline at end of file