Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nodes = [
- { :hostname => '0001web1', :ip => '192.168.33.10', :box => 'ubuntu/xenial64' },
- { :hostname => '0001web2', :ip => '192.168.33.11', :box => 'ubuntu/xenial64' },
- { :hostname => '0001lb1', :ip => '192.168.33.12', :box => 'ubuntu/xenial64' },
- { :hostname => '0001db1', :ip => '192.168.33.13', :box => 'ubuntu/xenial64' }
- ]
- Vagrant.configure("2") do |config|
- nodes.each do |node|
- config.vm.define node[:hostname] do |nodeconfig|
- nodeconfig.vm.box = "ubuntu/xenial64"
- nodeconfig.vm.hostname = node[:hostname] + ".box"
- nodeconfig.vm.network :private_network, ip: node[:ip]
- nodeconfig.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/me.pub"
- nodeconfig.vm.provision "shell", inline: "cat ~vagrant/.ssh/me.pub >> ~vagrant/.ssh/authorized_keys"
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement