Skip to content

A Cookiecutter template for developing Ansible roles TDD-style with Test-Kitchen and Serverspec.

License

Notifications You must be signed in to change notification settings

rosstimson/cookiecutter-tdd-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cookiecutter-tdd-ansible

Cookiecutter template for creating an Ansible role alongside Test-Kitchen.

I have grown used to, and love, developing Chef Cookbooks using a TDD approach with Test-Kitchen and Serverspec and wanted to develop my Ansible roles in a similar fashion. This Cookiecutter template quickly scaffolds everything needed to TDD an Ansible role.

Usage

Generate an Ansible role TDD-syle with:

cookiecutter https://github.com/rosstimson/cookiecutter-tdd-ansible

Once the Ansible role project has been setup cd into it and get the Rubygems needed for running Test-Kitchen with:

bundle install

Edit the .kitchen.yml to suit your specific needs, e.g. change the platform - the template defaults to CentOS 6.6.

If you're not familiar with Test-Kitchen just run:

bundle exec kitchen -h

Note

It is important that the root directory of the project/role is the same as the role specified in the test Playbook at <root>/test/integration/default.yml.

This gotcha might catch you out if you have your role in Github named something like <gh_username>/ansible-tmux but the Playbook has just tmux defined so remember to keep this in mind when cloning you role repos.

License

MIT

Author Information

Author:: Ross Timson [email protected], rosstimson.com

About

A Cookiecutter template for developing Ansible roles TDD-style with Test-Kitchen and Serverspec.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages