-
-
Save celesteking/64ef990d8f8f9d56cb3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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