Sign inSign up

zakihmkc/ansible

By zakihmkc

•Updated over 2 years ago

unofficial Ansible Docker image

Image
0

263

zakihmkc/ansible repository overview

⁠Dockerfile

⁠How to use

$ ls
ansible.cfg  inventory.ini  playbook.yml

⁠ansible.cfg

ignore ssh configure

[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null

⁠inventory.ini

[hosts]
client1
client2
client3

[all:vars]
ansible_user=remote_username

⁠ansible (password authentication)

$ docker run -v "$PWD":/mnt -w /mnt -it --rm zakihmkc/ansible:2.8.13 ansible all -i /mnt/inventory.ini -m ping -k

⁠ansible (publickey authentication)

$ docker run -v "$PWD":/mnt -w /mnt -v ~/.ssh:/.ssh  -it --rm zakihmkc/ansible:2.8.13 ansible all -i inventory.ini --private-key /.ssh/id_rsa_nopass -m ping

⁠ansible-playbook

$ docker run -v "$PWD":/mnt -w /mnt -v ~/.ssh:/.ssh  -it --rm zakihmkc/ansible:2.8.13 ansible-playbook -i inventory.ini --private-key /.ssh/id_rsa_nopass playbook.yml

Tag summary

Content type

Image

Digest

sha256:6166f4a2e…

Size

53.8 MB

Last updated

over 2 years ago

docker pull zakihmkc/ansible:alpine-ansible-pip