Vagrant::Config.run do |config| [:app].each_with_index do |role, i| config.vm.define(role, primary: true) do |config| config.vm.box = role config.vm.box = 'precise64' config.vm.box_url = 'http://files.vagrantup.com/precise64.box' config.vm.forward_port 22, "222#{i}".to_i config.vm.provision :shell, inline: 'yes | sudo apt-get install git-core' end end end