Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: Vagrantfile

Issue 9193009: Set up multi VM test environment (Closed)
Patch Set: Make the block optional Created Jan. 14, 2013, 4:15 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Vagrantfile
===================================================================
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -1,19 +1,26 @@
-Vagrant::Config.run do |config|
- config.vm.define :webserver do |config|
- config.vm.box = "precise64"
- config.vm.box_url = "http://files.vagrantup.com/precise64.box"
- config.vm.network :hostonly, "10.8.0.97"
+def define_standard_vm(config, name, address)
+ config.vm.define name do |config|
+ config.vm.box = 'precise64'
+ config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
+ config.vm.network :hostonly, address
config.vm.provision :puppet do |puppet|
puppet.manifests_path = 'manifests'
- puppet.manifest_file = 'webserver.pp'
+ puppet.manifest_file = name.to_s() + '.pp'
puppet.module_path = 'modules'
end
- local_anwiki_repository = "../anwiki"
+ yield(config) if block_given?
+ end
+
+end
+
+Vagrant::Config.run do |config|
+ define_standard_vm config, :webserver, '10.8.0.97' do |config|
+ local_anwiki_repository = '../anwiki'
if File.directory?(local_anwiki_repository)
- config.vm.share_folder("local_anwiki_repository",
- "/mnt/local_anwiki_repository", local_anwiki_repository)
+ config.vm.share_folder('local_anwiki_repository',
+ '/mnt/local_anwiki_repository', local_anwiki_repository)
end
end
end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld