Guest User

Untitled

a guest
Sep 22nd, 2015
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Vagrant.configure('2') do |config|
  2. [
  3. {:node => "n01", :ip => "172.16.222.10", :box => "debian/jessie64"},
  4. {:node => "n02", :ip => "172.16.222.11", :box => "puphpet/debian75-x64"}
  5. ].each do |node|
  6. config.vm.define node[:node] do |machine|
  7. machine.vm.box = "#{node[:box]}"
  8. machine.vm.network 'private_network', ip: node[:ip]
  9. machine.vm.hostname = "#{node[:node]}"
  10.  
  11. machine.vm.provision "shell" do |s|
  12. ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_dsa.pub").first.strip
  13. s.inline = <<-SHELL
  14. echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
  15. SHELL
  16. end
  17. end
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment