vagrant-configspec is a vagrant plugin that implements configspec as a provisioner. Issues and pull requests are welcome.
Install the Vagrant Configspec plugin
$ vagrant plugin install vagrant-configspec
Configure the provisioner
Vagrant.configure('2') do |config|
# ...
config.vm.provision :configspec do |spec|
spec.pattern = '*_spec.rb'
end
end
You'll want to place some boilerplate into a file named spec_helper.rb
require 'configspec'
require 'pathname'
require 'net/ssh'
include SpecInfra::Helper::Ssh
include SpecInfra::Helper::DetectOS
Then you're ready to write your specs
require_relative 'spec_helper'
describe package('httpd') do
it { should be_installed }
end