Skip to content

Instantly share code, notes, and snippets.

@celesteking
Created June 18, 2012 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celesteking/64ef990d8f8f9d56cb3c to your computer and use it in GitHub Desktop.
Save celesteking/64ef990d8f8f9d56cb3c to your computer and use it in GitHub Desktop.
require 'ostruct'
class LucidBox < OpenStruct
def initialize(hash)
raise ArgumentError unless hash.is_a?(Hash)
super(hash)
end
def apply_config(config)
config.vm.box = name
config.vm.box_url = url
# Increase vagrant's patience during hang-y CentOS bootup
# see: https://github.com/jedi4ever/veewee/issues/14
config.ssh.max_tries = 50
config.ssh.timeout = 300
# Port forwarding
config.vm.forward_port port, port
# Set IP
config.vm.network :hostonly, ip
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = name + ".pp"
end
self
end
end
# define URL
lucid32 = "http://files.vagrantup.com/lucid32.box"
# Main
Vagrant::Config.run do |config|
config.vm.define :web do |cf|
LucidBox.new(:name => 'web', :url => lucid32, :port => 8000, :ip => "10.10.10.20").apply_config(cf)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment