Skip to content

Instantly share code, notes, and snippets.

@ajohnstone
Created August 10, 2012 14:00
Show Gist options
  • Save ajohnstone/3314412 to your computer and use it in GitHub Desktop.
Save ajohnstone/3314412 to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
nodes = {
'http' => [3, 10],
'db' => [2, 20],
}
Vagrant::Config.run do |config|
config.vm.box = "base"
nodes.each do |prefix, (count, ip_start)|
count.times do |i|
hostname = "%s-%02d" % [prefix, (i+1)]
config.vm.define "#{hostname}" do |box|
box.vm.host_name = "#{hostname}"
box.vm.network :hostonly, "33.33.33.#{ip_start+i}", :netmask => "255.255.255.0"
box.vm.provision :puppet do |puppet|
puppet.module_path = '...'
puppet.manifests_path = 'nodes'
puppet.manifest_file = "#{prefix}.pp"
end
box.vm.customize [
"modifyvm", :id,
"--name", hostname,
"--memory", "512",
]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment