GithubHelp home page GithubHelp logo

stigkj / vagrant-serverspec Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vvchik/vagrant-serverspec

0.0 2.0 0.0 143 KB

Vagrant plugin that integrates serverspec

License: MIT License

Ruby 100.00%

vagrant-serverspec's Introduction

vagrant-serverspec

vagrant-serverspec is a vagrant plugin that implements serverspec as a provisioner.

Issues and pull requests are welcome.

Installing

Standart way

First, install the plugin.

$ vagrant plugin install vagrant-serverspec

In case of fork usage

in case of fork usage you need to build it first

gem build vagrant-serverspec.gemspec

(on windows you may use embedded vagrant ruby for that)

C:\HashiCorp\Vagrant\embedded\bin\gem.bat build vagrant-serverspec.gemspec

after that install plugin from filesystem

vagrant plugin install ./vagrant-serverspec-0.5.0.gem

Example Usage

Next, configure the provisioner in your Vagrantfile.

Vagrant.configure('2') do |config|
  config.vm.box = 'precise64'
  config.vm.box_url = 'http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-amd64-disk1.box'

  config.vm.provision :shell, inline: <<-EOF
    sudo ufw allow 22
    yes | sudo ufw enable
  EOF

  config.vm.provision :serverspec do |spec|
    spec.pattern = '*_spec.rb'
  end
end

You may want to override standart settings, file named spec_helper.rb usually used for that. For now possible examples is commented in this file.

# Disable sudo
# set :disable_sudo, true

# Set environment variables
# set :env, :LANG => 'C', :LC_MESSAGES => 'C' 

# Set PATH
# set :path, '/sbin:/usr/local/sbin:$PATH'

Then you're ready to write your specs.

require_relative 'spec_helper'

describe package('ufw') do
  it { should be_installed }
end

describe service('ufw') do
  it { should be_enabled }
  it { should be_running }
end

describe port(22) do
  it { should be_listening }
end

vagrant-serverspec's People

Contributors

vvchik avatar athak avatar jvoorhis avatar mizzy avatar

Watchers

Stig Kleppe-Jørgensen avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.