Change nodes generation for Vagrant

Master IP is .10, nodes start from .11
This commit is contained in:
Aleksandr Didenko 2016-07-11 13:00:57 +02:00
parent f33f447b3d
commit d0dd69399e

10
Vagrantfile vendored
View file

@ -31,7 +31,7 @@ system 'bash vagrant-scripts/ssh-keygen.sh'
# Create nodes list for future kargo deployment # Create nodes list for future kargo deployment
nodes="" nodes=""
(2..$num_instances).each do |i| (1..$num_instances-1).each do |i|
ip = "#{$private_subnet}.#{i+10}" ip = "#{$private_subnet}.#{i+10}"
nodes = "#{nodes}#{ip}\n" nodes = "#{nodes}#{ip}\n"
end end
@ -39,13 +39,9 @@ File.open("nodes", 'w') { |file| file.write(nodes) }
# Create the lab # Create the lab
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
(1..$num_instances).each do |i| (0..$num_instances-1).each do |i|
# First node would be master node # First node would be master node
if i == 1 master = i == 0
master = true
else
master = false
end
config.ssh.insert_key = false config.ssh.insert_key = false
vm_name = "%s-%02d" % [$instance_name_prefix, i] vm_name = "%s-%02d" % [$instance_name_prefix, i]