Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- mode: ruby -*-
- # vi: set ft=ruby :
- hosts = {
- "client" => "192.168.33.11",
- "server" => "192.168.33.10",
- }
- Vagrant.configure("2") do |config|
- hosts.each do |name, ip|
- config.vm.define name do |machine|
- machine.vm.box = "bento/ubuntu-14.04"
- machine.vm.hostname = "%s.example.org" % name
- machine.vm.network :private_network, ip: ip
- machine.vm.provider "virtualbox" do |v|
- v.name = name
- v.customize ["modifyvm", :id, "--memory", 200]
- end
- config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true
- config.vm.network "forwarded_port", guest: 443, host: 2443, auto_correct: true
- ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
- machine.vm.provision 'shell', inline: "echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys", privileged: false
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement