#!/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" "$@"