1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
capistrano/spec/support/Vagrantfile

24 lines
802 B
Text
Raw Normal View History

2016-02-28 18:16:11 -05:00
require "open-uri"
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
[:app].each_with_index do |role, i|
2016-02-28 18:14:50 -05:00
config.vm.define(role, :primary => true) do |primary|
primary.vm.define role
2016-02-28 18:16:11 -05:00
primary.vm.box = "hashicorp/precise64"
2016-02-28 18:14:50 -05:00
primary.vm.network "forwarded_port", :guest => 22, :host => "222#{i}".to_i
2016-02-28 18:16:11 -05:00
primary.vm.provision :shell, :inline => "sudo apt-get -y install git-core"
2016-03-01 10:02:00 -05:00
vagrantkey = open("https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub", "r", &:read)
primary.vm.provision :shell,
2016-03-01 10:16:14 -05:00
:inline => <<-INLINE
install -d -m 700 /root/.ssh
echo -e "#{vagrantkey}" > /root/.ssh/authorized_keys
chmod 0600 /root/.ssh/authorized_keys
INLINE
end
end
end