1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
capistrano/spec/support/Vagrantfile
Chad Shaffer d6f4499ee8 Address all rubocop lint warnings
* (File, Dir).exists? -> (File, Dir).exist?
* Prepend unused parameter names with an underscore
* Prefer “safe assignment in condition”
* Disambiguate splat operators with parens
* Remove unnecessary assignments (unused variables)
* No longer shadow Vagrant config variable name in Vagrantfile
* Removed some trailing whitespace

Fixes #1404
2015-08-14 14:21:34 -07:00

24 lines
768 B
Ruby

require 'open-uri'
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
[:app].each_with_index do |role, i|
config.vm.define(role, primary: true) do |primary|
primary.vm.define role
primary.vm.box = 'hashicorp/precise64'
primary.vm.network "forwarded_port", guest: 22, host: "222#{i}".to_i
primary.vm.provision :shell, inline: 'sudo apt-get -y install git-core'
vagrantkey = open("https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub", "r",&:read)
primary.vm.provision :shell,
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