Skip to content
Browse files


  • Loading branch information...
Frzk committed Mar 19, 2019
1 parent 87b3aae commit df7d5b9a82721111de164e156c6b53e30b71ee33
Showing with 146 additions and 0 deletions.
  1. +32 −0
  2. +114 −0
@@ -0,0 +1,32 @@
# How to Contribute

## Pull Requests

1. Fork this repository
2. Create a new branch for each feature or improvement
3. Send a pull request from each feature branch to the **develop** branch

It is very important to separate new features or improvements into separate feature branches, and to send a
pull request for each branch. This allows me to review and pull in new features or improvements individually.

## Bug Reports

1. Create an issue [here](
2. Add the `bug` label to the issue
3. Please provide as many details as you can (environment, steps to reproduce, config file, ...)

## Feature Requests

Feature Requests are only for **NEW** features. For existing features, please make an Enhancement Request.

1. Create an issue [here](
2. Add the `feature-request` label to the issue
3. Please describe the feature in a detailed way, with examples and use cases

## Enhancement Requests

Enhancement Requests are only for **EXISTING** features. For a new feature, please make a Feature Request.

1. Create an issue [here](
2. Add the `enhancement` label to the issue
3. Describe your idea
@@ -0,0 +1,114 @@
# Archlinux Ansible test image

![Build Status]( ![Automated]( ![Pulls]( ![Stars](

Archlinux Docker image for Ansible role testing in Travis-CI.

> TL;DR: `docker pull kblr/archlinux-ansible`

## Overview

I use Docker in Travis-CI to test my Ansible roles on multiple OS.

This repo allows me to (automatically) build an Archlinux image from the provided `Dockerfile`. This image contains the needed tools to run Ansible and the tests.

The image is built by Docker Hub automatically each time one of the following happens:
- the upstream OS container is updated;
- a commit is made on the `master` branch of this repo.

## How-to use with Travis-CI...

### ...And Molecule (recommended)

Simply tell Travis to pull the image from Docker Hub and run a container based on it.

To do so, edit your `molecule.yml` file like this (just an example, the most important part is in the `platforms` section):

name: galaxy
name: docker
name: yamllint
- name: instance
image: "kblr/archlinux-ansible:latest"
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
name: ansible
name: ansible-lint
converge: "playbook.yml"
name: default
name: testinfra

### ...And bash (not advised)

Your `.travis.yml` file should look like this:

sudo: required
language: bash
- docker
# Pull the image from Docker Hub:
- docker pull kblr/archlinux-ansible:latest
# Run a container based on the previously pulled image:
- >
docker run
--name "${TRAVIS_COMMIT}.archlinux"
--mount type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup,readonly
--mount type=bind,source="$(pwd)",target=/etc/ansible/roles/under_test,readonly
# Execute tests:
- >
docker exec "${TRAVIS_COMMIT}.archlinux"
ansible-playbook -v /etc/ansible/roles/under_test/tests/test/yml --syntax-check
- >
docker exec ...
- docker rm -f "${TRAVIS_COMMIT}.archlinux"

## How-to use locally

If you ever need to build the image manually:

1. [Install Docker](
2. `git clone` this repo
3. `cd` in the freshly cloned repo
4. Build the image using `docker build --no-cache --rm --tag="archlinux:ansible" .`
5. `cd` in your Ansible role directory
5. From there, run a container using `docker run --name [whatever] --detach --privileged --mount type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup,readonly --mount type=bind,source="$(pwd)",target=/etc/ansible/roles/under_test,readonly archlinux:ansible`

## Contributing

Code reviews, patches, comments, bug reports and feature requests are welcome. Please read the [Contributing Guide]( for further details.

0 comments on commit df7d5b9

Please sign in to comment.
You can’t perform that action at this time.