$ ls
ansible.cfg inventory.ini playbook.yml
ignore ssh configure
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
[hosts]
client1
client2
client3
[all:vars]
ansible_user=remote_username
$ docker run -v "$PWD":/mnt -w /mnt -it --rm zakihmkc/ansible:2.8.13 ansible all -i /mnt/inventory.ini -m ping -k
$ 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
$ 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
Content type
Image
Digest
sha256:6166f4a2e…
Size
53.8 MB
Last updated
over 2 years ago
docker pull zakihmkc/ansible:alpine-ansible-pip