X-Git-Url: https://pwan.org/git/?p=vagrant-dotfiles.git;a=blobdiff_plain;f=lib%2Fcopy_my_conf%2Fssh.rb;fp=lib%2Fcopy_my_conf%2Fssh.rb;h=0000000000000000000000000000000000000000;hp=38e7643caf036e2e7c8f36820446121683f2767e;hb=e83a68ac49cf7bf169e58b5706605b072b4966a3;hpb=fa35bc36a5430811c454bc6f93aca0f6bdf20348 diff --git a/lib/copy_my_conf/ssh.rb b/lib/copy_my_conf/ssh.rb deleted file mode 100644 index 38e7643..0000000 --- a/lib/copy_my_conf/ssh.rb +++ /dev/null @@ -1,16 +0,0 @@ -module CopyMyConf - class Ssh - def prepare vm, tmp_root - vm.synced_folder("#{ENV['HOME']}/.ssh", "#{tmp_root}/ssh",:id => "ssh") - end - - def provision channel, user_home, tmp_root - puts "Copying your ssh keys and config" - channel.sudo("mkdir -p #{tmp_root}/cached && chown -R vagrant #{tmp_root}/cached") - channel.execute("[[ -f #{user_home}/.ssh/authorized_keys ]] && mv #{user_home}/.ssh/authorized_keys #{tmp_root}/cached") - channel.execute("cp #{tmp_root}/ssh/* #{user_home}/.ssh") - channel.execute("cat #{tmp_root}/cached/authorized_keys >> #{user_home}/.ssh/authorized_keys") # So that `vagrant ssh` doesn't ask for password - end - - end -end