summaryrefslogtreecommitdiffstats
path: root/ansible/ansible.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2025-10-22 07:55:05 +0200
committerSuren A. Chilingaryan <csa@suren.me>2025-10-22 07:55:05 +0200
commite4ef3c8c1bbf0e4ebde8a5479fd7b79180080970 (patch)
tree4202b5686fa98568517dcfa89e9e84cf926bb3d6 /ansible/ansible.sh
parentf2a7ddb5e8df88092b4f8b59088e43d095c93556 (diff)
downloadands-e4ef3c8c1bbf0e4ebde8a5479fd7b79180080970.tar.gz
ands-e4ef3c8c1bbf0e4ebde8a5479fd7b79180080970.tar.bz2
ands-e4ef3c8c1bbf0e4ebde8a5479fd7b79180080970.tar.xz
ands-e4ef3c8c1bbf0e4ebde8a5479fd7b79180080970.zip
Add Dockerfile and shell wrapper to make it work on the systems with newer version ansibleHEADmaster
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