Sign inSign up

omnys/ansible

By omnys

•Updated over 4 years ago

Ansible image

Image
0

471

omnys/ansible repository overview

⁠Docker with ansible

Inspired by: https://github.com/willhallonline/docker-ansible⁠

An "ansible" user is created inside the container and used to execute commands. Change the "/home/user" path with your local environment.

⁠Run in interactive mode

docker run  --rm -it \
    --mount type=bind,source="$(pwd)",target=/ansible \
    --mount type=bind,source=/home/user/.ssh,target=/home/ansible/.ssh \
    omnys/ansible:2.8.17 \
    bash

⁠Run a playbook

docker run  --rm -it \
    --mount type=bind,source="$(pwd)",target=/ansible \
    --mount type=bind,source=/home/user/.ssh,target=/home/ansible/.ssh \
    omnys/ansible:2.8.17 \    
    ansible-playbook playbook.yml

⁠Execute aws cli cmd from ansible

If you need to execute aws cli commands, and you want to load local aws profiles, add a custom mount:

... --mount type=bind,source=/home/user/.aws,target=/home/ansible/.aws ...

⁠Share the ssh agent socket with the container

... --volume $SSH_AUTH_SOCK:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent ...

Tag summary

Content type

Image

Digest

Size

335.5 MB

Last updated

over 4 years ago

docker pull omnys/ansible:211