Last active
June 1, 2017 11:43
-
-
Save aluminiumgeek/71475c2b47f2ca22f2be to your computer and use it in GitHub Desktop.
Key auth for Vagrant VMs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative '../vagrant/key_authorization' | |
Vagrant.configure('2') do |config| | |
config.vm.box = 'ubuntu/trusty64' | |
authorize_key_for_root config, '/home/mihail/.ssh/id_dsa.pub', '/home/mihail/.ssh/id_rsa.pub' | |
{ | |
'db' => '192.168.33.10', | |
'elasticsearch'=> '192.168.33.11', | |
'app' => '192.168.33.12' | |
}.each do |short_name, ip| | |
config.vm.define short_name do |host| | |
host.vm.network 'private_network', ip: ip | |
host.vm.hostname = "#{short_name}.rc" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! This is very helpful, however I'd recommend using
chef
for provisioning of your virtual machines.