Ansible-validator test and validate Ansible roles with this:
- Syntax check
- A first apply
- A second apply to check idempotence
Copy all the stuff into the Ansible role directory and run :
./validator
By default the test is the one in the defaults directory. But you can setup a tests directory into your projet repository with your own tests. Dynamically the validator will use them.
You just have to set some special vars in order to create your use case into the pattern below:
---
- hosts: all
vars: <= Here you can set some special vars in order to perform some use case
roles:
- role_under_test
The tests are applied on the docker systems (which are defined in the dockerfiles directory). You can select a part of this systems by creating the file named validator.list containing the list of your selection.
Example of validator.list:
debian-8
ubuntu-16.04
If you want to use it with Jenkins, you have to add these lines below as a build script :
rm -rf .git
rm readme.md
git init
git remote add origin git@github.com:olo-dw/ansible-validator.git
git fetch
git checkout -t origin/master
./validator
- Docker