Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (22 sloc) 1.02 KB
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Ask Vagrant not to randomly generate keys as we will supply our own keys
config.ssh.insert_key = false
# Tell Vagrant which private keys to use. We still need to keep the default Vagrant key
# as the next command would otherwise already try to use the Ansible key which is not yet
# in the authorized_keys file at this point in time
config.ssh.private_key_path = ['~/.vagrant.d/insecure_private_key', '~/vagrant/vagrant_key']
# Add our own key to authorized_keys file
config.vm.provision "file", source: "~/vagrant/vagrant_key.pub", destination: "~/.ssh/authorized_keys"
# We set up two boxes, connected to the same private network
# with static IP addresses
config.vm.define "boxA" do |boxA|
boxA.vm.box = "ubuntu/bionic64"
boxA.vm.network "private_network", ip: "192.168.33.10"
end
config.vm.define "boxB" do |boxB|
boxB.vm.box = "ubuntu/bionic64"
boxB.vm.network "private_network", ip: "192.168.33.11"
end
end
You can’t perform that action at this time.