make it easier to set up more than 2 VMs for testing
This commit is contained in:
1 parent
8f18df7a43
commit
5967d5de20
3 files changed
+25
-11
No files matched your search
Vendored
+9
-8
@@ -1,7 +1,9 @@
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
|
||||
host1_ip = "192.168.48.19" # arbitrary private IP
|
||||
host2_ip = "192.168.48.15" # arbitrary private IP
|
||||
# these ought to match what is in config.sh
|
||||
n_machines = 2
|
||||
ip_prefix = "192.168.48"
|
||||
ip_suffix_base = 10
|
||||
|
||||
def configure_docker(host, ip)
|
||||
pkgs = "lxc-docker"
|
||||
@@ -30,12 +32,11 @@ end
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
|
||||
config.vm.define "host1" do |host1|
|
||||
configure_docker(host1, host1_ip)
|
||||
end
|
||||
|
||||
config.vm.define "host2" do |host2|
|
||||
configure_docker(host2, host2_ip)
|
||||
(1..n_machines).each do |i|
|
||||
config.vm.define "host#{i}" do |host|
|
||||
ip_suffix = ip_suffix_base + i
|
||||
configure_docker(host, "#{ip_prefix}.#{ip_suffix}")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user