Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Welcome to VagrantSpec

Demitri Swan edited this page Aug 12, 2016 · 12 revisions

Introduction

VagrantSpec is a vagrant plugin that allows you to run system tests on a Vagrant node set after the build, configuration, and orchestration phases. The build phase is the instantiation of the node set. The configuration phase is the application of configuration management to your system. The orchestration phase is systematic application of coordinated events to converge into a ready state. After all is said and done, it is wise to validate that the system is functioning as desired. This is where vagrant_spec comes in.

This tutorial will walk you through the creation of the Vagrantfile, Ansible playbook configuration and execution, the deployment of Apache Mesos to the Vagrant virtual machines, and ServerSpec testing. Take a look at the next section to see what you'll need to get started.

What You'll Need

To get started, you'll need to download Vagrant and Virtualbox. Vagrant is the virtual machine manager that uses Ruby to configure local and remote node sets for development and testing. If this is new to you, please take a look at the vagrant tutorial. VirtualBox is the default virtual machine hypervisor for Vagrant. It is free and open source, so Vagrant will use it under the hood. You'll also need Ansible installed on your workstation. The simplest way to install Ansible is via pip install ansible

A basic understanding of Ruby syntax will be helpful in this tutorial. While a full command of the language is not required, Vagrant's configuration in the Vagrantfile is pure Ruby. If you're completely new to Ruby or programming in general, take a look at Code Academy to get a handle on the basics. The tutorial is very friendly for beginners and will help make sense of the strange do syntax you'll commonly see within Vagrantfiles.

A basic understanding of RSpec will be of use in this tutorial. ServerSpec is the most widely used framework for testing system resources to date. That being said, it was chosen as the core of the vagrant_spec plugin. Since it is an extension of RSpec, understanding RSpec fundamentals will be useful. However, it isn't mandatory for this tutorial. We will be going over some of those basics to get you up to speed.

Lastly, vagrant_spec officially supports OSX and Linux workstations at this time. While the plugin may work fine on Windows, it has not been tested on this platform so results may vary.

Now that we have all of that out of the way, let's jump right in.

##Next: Setup the Vagrant Configuration