diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2025-10-22 07:55:05 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2025-10-22 07:55:05 +0200 |
commit | e4ef3c8c1bbf0e4ebde8a5479fd7b79180080970 (patch) | |
tree | 4202b5686fa98568517dcfa89e9e84cf926bb3d6 /ansible | |
parent | f2a7ddb5e8df88092b4f8b59088e43d095c93556 (diff) | |
download | ands-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')
-rw-r--r-- | ansible/Dockerfile | 14 | ||||
-rw-r--r-- | ansible/ansible-build.sh | 1 | ||||
-rw-r--r-- | ansible/ansible-config.sh | 1 | ||||
-rwxr-xr-x | ansible/ansible.sh | 19 |
4 files changed, 35 insertions, 0 deletions
diff --git a/ansible/Dockerfile b/ansible/Dockerfile new file mode 100644 index 0000000..c654f6a --- /dev/null +++ b/ansible/Dockerfile @@ -0,0 +1,14 @@ +FROM cytopia/ansible:2.10-tools + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 + +RUN apk add --no-cache \ + bash openssh sshpass rsync curl jq git vim less \ + py3-netaddr \ + py3-paramiko py3-cryptography \ + py3-lxml py3-requests py3-yaml \ + py3-jmespath py3-xmltodict py3-jsonschema py3-psutil + +WORKDIR /work +CMD ["ansible", "--version"] diff --git a/ansible/ansible-build.sh b/ansible/ansible-build.sh new file mode 100644 index 0000000..74576da --- /dev/null +++ b/ansible/ansible-build.sh @@ -0,0 +1 @@ +docker build -t ansible:2.10-cytopia-plus . diff --git a/ansible/ansible-config.sh b/ansible/ansible-config.sh new file mode 100644 index 0000000..f1b2367 --- /dev/null +++ b/ansible/ansible-config.sh @@ -0,0 +1 @@ +for c in ansible ansible-playbook ansible-vault ansible-config ansible-console ansible-doc ansible-galaxy ansible-inventory ansible-pull ansible-test ansible-connection; do ln -sf /root/ansible.sh /usr/bin/$c; done 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 |