forked from puppetlabs/tasks-hands-on-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
29 lines (25 loc) · 866 Bytes
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- mode: ruby -*-
# vi: set ft=ruby :
$nodes_count = 1
if ENV['NODES'].to_i > 0 && ENV['NODES']
$nodes_count = ENV['NODES'].to_i
end
Vagrant.configure('2') do |config|
config.vm.box = 'centos/7'
config.ssh.forward_agent = true
(1..$nodes_count).each do |i|
config.vm.define "node#{i}" do |node|
ip = "192.168.50.#{i+100}"
node.vm.network "private_network", ip: ip
# We apply the following only to providers that support private networks
# for instance Hyper-V will ignore the above network configuration
# and should therefore ignore the SSH configuration too
['vmware_fusion', 'vmware_workstation', 'virtualbox'].each do |provider|
config.vm.provider provider do |_, override|
override.ssh.host = ip
override.ssh.port = 22
end unless ENV['BOOT']
end
end
end
end