Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vagrant.configure('2') do |config|
- [
- {:node => "n01", :ip => "172.16.222.10", :box => "debian/jessie64"},
- {:node => "n02", :ip => "172.16.222.11", :box => "puphpet/debian75-x64"}
- ].each do |node|
- config.vm.define node[:node] do |machine|
- machine.vm.box = "#{node[:box]}"
- machine.vm.network 'private_network', ip: node[:ip]
- machine.vm.hostname = "#{node[:node]}"
- machine.vm.provision "shell" do |s|
- ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_dsa.pub").first.strip
- s.inline = <<-SHELL
- echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
- SHELL
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment