VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", inline: "echo Hello"
config.vm.define "lvmweb" do |web|
web.vm.box = "precise32"
web.vm.hostname = "lvmweb"
web.vm.network "private_network", ip: "192.168.111.11"
end
config.vm.define "lvmdb" do |db|
db.vm.box = "precise32"
db.vm.hostname = "lvmdb"
db.vm.network "private_network", ip: "192.168.111.12"
end
config.vm.define "lvmlog" do |log|
log.vm.box = "precise32"
log.vm.hostname = "lvmlog"
log.vm.network "private_network", ip: "192.168.111.13"
end
end
I need to change the guests to run on different SSH ports than the default 22. Thats easily managed on the guests (changing the directive on /etc/ssh/sshd_config and then restarting ssh service). However once that is done, I need to update the vagrant file so that vagrant can talk to each of the respective guests on their respective ssh ports. I was unable to do so successfully (tried changing config.ssh.port and config.ssh.guest_port using my best guess at doing it at a per guest level in the multi-machine configuration. That did not work, and I imagine I did not know how to exactly apply that change within the syntax as defined (eg. should I do config.ssh.guest_port, web.ssh.guest_port, web.vm.ssh_port etc.)
So what is the exact directive I specify at per machine level to effect the change in ssh ports on the guests?