Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kibatic/docker-ansible
This projects allows you to run ansible from a docker container (without installing it on your computer)
https://github.com/kibatic/docker-ansible
Last synced: 17 days ago
JSON representation
This projects allows you to run ansible from a docker container (without installing it on your computer)
- Host: GitHub
- URL: https://github.com/kibatic/docker-ansible
- Owner: kibatic
- License: mit
- Created: 2016-04-29T13:11:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-25T12:04:10.000Z (about 2 months ago)
- Last Synced: 2024-11-30T00:44:37.165Z (24 days ago)
- Language: Dockerfile
- Homepage:
- Size: 34.2 KB
- Stars: 12
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
docker-ansible : using ansible without installing it
======================================================This docker allows you to use ansible on your computer without installing it.
This allows you to :
* share your ssh agent with the ansible docker
Just add these aliases to your ~/.bash_aliases in order to use ansible as it where installed on your computer.
```bash
export DOCKER_ANSIBLE_VERSION=2.0
base_ansible() {
docker run -it --rm --env ANSIBLE_REMOTE_USER=${USER} --volume $SSH_AUTH_SOCK:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent -v ${PWD}:${PWD} -v ${HOME}/.ssh/known_hosts:/root/.ssh/known_hosts -w ${PWD} kitpages/docker-ansible:${DOCKER_ANSIBLE_VERSION} $@
}
alias ansible='base_ansible ansible'
alias ansible-playbook='base_ansible ansible-playbook'
alias ansible-vault='base_ansible ansible-vault'
alias ansible-galaxy='base_ansible ansible-galaxy'
```## Usage
Simply use your aliases, and you can override ansible default version when required
```bash
$ ansible --version
ansible 2.0.2.0
config file = /tmp/ansible.cfg
configured module search path = Default w/o overrides$ DOCKER_ANSIBLE_VERSION=2.3 ansible --version
ansible 2.3.1.0
config file = /tmp/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Jun 8 2017, 21:01:38) [GCC 4.9.2]
```