diff --git a/Vagrantfile b/Vagrantfile index da99fa4..a7655a2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -50,6 +50,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end config.vm.provision(:shell){ |shell| shell.path = "script/fix_stdin_error.sh" } + ssh_port = 2222 boxes.each do |box| config.vm.define box[:name] do |node| node.vm.provider :virtualbox do |vb| @@ -67,6 +68,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| "--macaddress2", box[:mac]] end + config.vm.network :forwarded_port, + guest: 22, + host: ssh_port, + id: "ssh", + auto_correct: true + ssh_port += 1 + node.vm.hostname = box[:name] node.vm.provision :chef_solo do |chef| chef_default.call(chef)