Skip to content

Commit

Permalink
adding READmE
Browse files Browse the repository at this point in the history
  • Loading branch information
extremelylongusername committed Jan 30, 2016
1 parent 8fa7ec8 commit 752ac10
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
@@ -0,0 +1,34 @@
## Ansible Test Kitchen Example

We can use [test-kitchen](https://github.com/test-kitchen/test-kitchen) with [serverspec](http://serverspec.org/) to run some basic tests for our ansible roles.

Test kitchen allows us to do the following

```
1. spin up docker container
2. provision container using ansible role
3. test that our ansible role did everything we wanted it to
```

The files contained in this repo should be enough to get you easily started with testing ansible roles using serverspec.

##### 0. `requirements.yml`

This are the dependencies listed in meta/main of your ansible role. If there are no dependecies, remove `requirements_path:` from `.kitchen.yml`

##### 1. `.travis.yml`

Describes how to run everything on travis-ci. If you are not using travis-ci, you can omit this file.

##### 2. `.kitchen.yml`

Describes what to run our serverspec tests on (docker, vagrant, ec2), and how to provision our hosts.

##### 3. `/test/integration/serverspec/default.yml`

This is the ansible playbook we run to provision our hosts. The most basic function is just installing our ansible role on the host machine.

#### 4. `/test/integration/serverspec/localhost/default_spec.rb`

This is the serverspec file that contains the tests to run against our hosts. For resource types see the (documentation)[http://serverspec.org/resource_types.html].

7 changes: 7 additions & 0 deletions requirements.yml
@@ -0,0 +1,7 @@
# find the dependencies to list in meta/main.
# If there are non, remove this file and the reference to it in .kitchen.yml
# Otherwise should look something like below:
#
---
# - src: noqcks.apt-repository

0 comments on commit 752ac10

Please sign in to comment.