Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garethr/packer-serverspec-example
Using Serverspec tests to verify images built using Packer
https://github.com/garethr/packer-serverspec-example
Last synced: about 1 month ago
JSON representation
Using Serverspec tests to verify images built using Packer
- Host: GitHub
- URL: https://github.com/garethr/packer-serverspec-example
- Owner: garethr
- License: mit
- Created: 2014-01-01T15:17:36.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-18T17:58:33.000Z (over 10 years ago)
- Last Synced: 2024-11-02T01:50:28.648Z (about 2 months ago)
- Language: Ruby
- Size: 243 KB
- Stars: 97
- Watchers: 10
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Packer Serverspec Example
[![wercker
status](https://app.wercker.com/status/e0e5ae1131427238297c028dbcc2bfeb
"wercker
status")](https://app.wercker.com/project/bykey/e0e5ae1131427238297c028dbcc2bfeb)[Packer](http://www.packer.io/) provides a great way of describing the steps
for creating a virtual machine image. But it doesn't have a built-in way
of verifying those images.[Serverspec](http://serverspec.org/) provides a nice framework for
writing tests against infrastructure, asserting the operation of
services or the installation of packages.This repo demonstrates a simple integration between Packer and
Serverspec, using Serverspec tests to validate the instance provisioning
before the image is created.
## Installation
First you need to [install
Packer](http://www.packer.io/intro/getting-started/setup.html).Next download the Puppet modules described in the Puppetfile. For this
we're using [Bundler](http://bundler.io/) which you'll need installed.bundle install
bundle exec librarian-puppet install## Usage
Now you'll need to set a couple of Amazon environment variables:
export AWS_ACCESS_KEY_ID=xxxx
export AWS_SECRET_ACCESS_KEY=xxxxAnd finally run Packer:
packer build template.json
This will boot an AWS instance, install Puppet, use Puppet to install various
bits of software, then run the test suite. Only if all of that works
will it build the AMI.