https://github.com/phansible/docker-ansible
A docker ansible image to test Phansible roles
https://github.com/phansible/docker-ansible
ansible docker hacktoberfest
Last synced: 2 months ago
JSON representation
A docker ansible image to test Phansible roles
- Host: GitHub
- URL: https://github.com/phansible/docker-ansible
- Owner: phansible
- License: mit
- Created: 2016-05-08T16:34:57.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-11-21T01:26:48.000Z (over 6 years ago)
- Last Synced: 2025-01-25T11:26:26.606Z (over 1 year ago)
- Topics: ansible, docker, hacktoberfest
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Docker ansible
Ansible in a docker container
The main objective of this image is to help phansible developers to test their roles when developing
It can be used as a normal ansible image but we will not provide support for that use case
## Testing a role
The image provides a bash entrypoint to help you testing the role.
Let's use `role-apache` as our role and `ubuntu 14.04` as our environment for this example.
### Syntax check
In order to check if the syntax of your role is correct:
```
docker run --rm -it -v "$PWD:/roles/role-apache" -e "ROLE=role-apache" phansible/ansible:ubuntu1404 syntax
```
This is the default command for the image, so you can also type
```
docker run --rm -it -v "$PWD:/roles/role-apache" -e "ROLE=role-apache" phansible/ansible:ubuntu1404
```
### Run the provisioning
To test if the provision does not fail
```
docker run --rm -it -v "$PWD:/roles/role-apache" -e "ROLE=role-apache" phansible/ansible:ubuntu1404 run
```
### Idempotency check
For us, idempotency is key in our roles. To ensure that your changes are idempotent do:
```
docker run --rm -it -v "$PWD:/roles/role-apache" -e "ROLE=role-apache" phansible/ansible:ubuntu1404 idempotent
```
### Other testings
In some cases you may need to enter the container and execute a few checks manually. For that just run
```
docker run --rm -it -v "$PWD:/roles/role-apache" -e "ROLE=role-apache" phansible/ansible:ubuntu1404 bash
```