Copy the id_rsa.pub key to the vm where possible

This allows dokku-installer to automatically list the public key in it's UI
This commit is contained in:
Jose Diaz-Gonzalez
2015-01-12 01:37:11 -05:00
parent 20bb7caef4
commit 87b7a74cf0

6
Vagrantfile vendored
View File

@@ -7,6 +7,7 @@ BOX_MEMORY = ENV["BOX_MEMORY"] || "1024"
DOKKU_DOMAIN = ENV["DOKKU_DOMAIN"] || "dokku.me"
DOKKU_IP = ENV["DOKKU_IP"] || "10.0.0.2"
PREBUILT_STACK_URL = File.exist?("#{File.dirname(__FILE__)}/stack.tgz") ? 'file:///root/dokku/stack.tgz' : nil
PUBLIC_KEY_PATH = "#{Dir.home}/.ssh/id_rsa.pub"
make_cmd = "make install"
if PREBUILT_STACK_URL
@@ -48,4 +49,9 @@ Vagrant::configure("2") do |config|
config.vm.define "build", autostart: false do |vm|
vm.vm.provision :shell, :inline => "cd /root/dokku && make deb-all"
end
if Pathname.new(PUBLIC_KEY_PATH).exist?
config.vm.provision :file, source: PUBLIC_KEY_PATH, destination: '/tmp/id_rsa.pub'
config.vm.provision :shell, :inline => "rm /root/.ssh/authorized_keys && mv /tmp/id_rsa.pub /root/.ssh/authorized_keys"
end
end