Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.
phansiblePublic archive

About

A docker ansible image to test Phansible roles

Topics

Resources

Code of conduct

Stars

0 stars

Watchers

2 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Docker ansible

Warning

Deprecated. This image is no longer maintained. It only ever shipped Ubuntu 14.04 and was last built in 2016. Phansible roles are now tested in each role's GitHub Actions workflow on official Debian and Ubuntu images.

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

About

A docker ansible image to test Phansible roles

Topics

Resources

Code of conduct

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages