Created
August 10, 2012 14:00
-
-
Save ajohnstone/3314412 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# -*- 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