Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Molecule | 3,531 | 525 | 25 | 12 days ago | 188 | June 16, 2022 | 49 | mit | Python | |
Molecule aids in the development and testing of Ansible roles | ||||||||||
Pytest Testinfra | 2,173 | 457 | 9 | 25 days ago | 90 | November 12, 2020 | 129 | apache-2.0 | Python | |
Testinfra test your infrastructures | ||||||||||
Morph | 454 | 6 months ago | 351 | agpl-3.0 | Ruby | |||||
Take the hassle out of web scraping | ||||||||||
Kitchen Ansible | 347 | 585 | 2 years ago | 99 | April 09, 2021 | 7 | other | Ruby | ||
Ansible Provisioner for Test Kitchen | ||||||||||
Openshift Ansible Contrib | 291 | 2 years ago | 20 | apache-2.0 | Python | |||||
Additional roles and playbooks for OpenShift installation and management | ||||||||||
Rolespec | 233 | 5 years ago | 14 | gpl-3.0 | Shell | |||||
A test library for testing Ansible roles | ||||||||||
Ansible Test | 162 | 5 years ago | 7 | mit | Python | |||||
An Ansible Testing Framework for Humans | ||||||||||
Ansible Dev By Example | 133 | 6 years ago | mit | |||||||
:boom: Ansible module development with examples and walk-throughs | ||||||||||
Goss Ansible | 106 | 2 years ago | 2 | mit | Python | |||||
Ansible module for Goss | ||||||||||
Ansible Template Ui | 95 | 4 months ago | 4 | apache-2.0 | Python | |||||
Web UI for testing ansible templates |
Ansible-test is a tool for testing your automation on local docker images. You can think of this as a slim version of Chef's test-kitchen.
$ cd /my/ansible/repository
$ ansible-test my_ansible_role
The above command will drop a Dockerfile at the root of your ansible repo and initialize a docker image with ansible installed. It will then run the ansible role "my_ansible_role".
Note that ansible-test also accepts arbitrary arguments. These arguments will be passed on to the ansible-playbook command while running tests:
ansible-test my_ansible_role --ask-vault-pass
Ansible test also accepts an image argument to specify the base docker image:
ansible-test my_ansible_role --image ubuntu:latest
See the example ansible flask project, which tests with ansible-test out-of-the-box
To install ansible-test:
$ pip install ansible-test
ansible-test requires that you have docker installed locally. If you are using Mac OSX, I recommend you use boot2docker.
NOTE: Given docker's inflexibility with Dockerfiles, ansible-test will overwrite the Dockerfile in the current working directory from which you run ansible-test. This is currently the simplest way to integrate docker as a testing tool.
usage: ansible-test [-h] [--image IMAGE] [--family {Debian,RedHat,Gentoo}]
role
positional arguments:
role Role to test
optional arguments:
-h, --help show this help message and exit
--image IMAGE, -i IMAGE
Docker Base Image
--family {Debian,RedHat,Gentoo}, -f {Debian,RedHat,Gentoo}
ansible_os_family value for Base Image
Tested image/family combinations:
Rather than being able to simply pull official gentoo docker images, it was necessary to merge the stage3 and portage images to work around a docker limitation: docker currently has no way to mount volumes while building an image, only when starting up a container from an already-built image (see https://github.com/docker/docker/issues/3949 for further discussion of this limitation).
See base-images/Dockerfile.gentoo-amd64-portage as example for creating base image for testing on Gentoo. This Dockerfile inherits from gentoo/stage3-amd64 Dockerfile and adds the commands from gentoo/portage Dockerfile in order to create a full stage3 image with /usr/portage included rather than relying on a separage image containing a portage volume.