Sign inSign up

tomxiong/ansible

By tomxiong

•Updated over 6 years ago

ansible image base on minidebian

Image
0

267

tomxiong/ansible repository overview

⁠Ansible

Ansible inside Docker for consistent running of ansible inside your local machine or CI/CD system.

⁠Ansible 2.8 (with Mitogen)

This is my preferred install variant mainly due to the performance improvements that Mitogen awards you. You can read more about it inside the Mitogen for Ansible documentation⁠.

⁠Running

**You will likely need to mount required directories into your container to make it run (or build on top of what is here).

⁠Simple
$~   docker run --rm -it tomxiong/ansible /bin/sh
⁠Mount local directory and ssh key
$~  docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa tomxiong/ansible:2.8 /bin/sh
⁠Injecting commands
$~  docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa tomxiong/ansible:2.8 ansible-playbook playbook.yml
⁠Bash Alias

You can put these inside your dotfiles (~/.bashrc or ~/.zshrc to make handy aliases).

alias docker-ansible-cli='docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --workdir=/ansible tomxiong/ansible:2.8-alpine /bin/sh'
alias docker-ansible-cmd='docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --workdir=/ansible tomxiong/ansible:2.8-alpine '

use with:

$~  docker-ansible-cli ansible-playbook -u playbook.yml

Tag summary

Content type

Image

Digest

Size

73.4 MB

Last updated

over 6 years ago

docker pull tomxiong/ansible