From: Volker Theile Date: Mon, 11 Nov 2019 09:15:18 +0000 (+0100) Subject: mgr/ssh: Install SSH public key in Vagrantfile box fails X-Git-Tag: v15.1.0~961^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8593c7e2593def4f3258a32888edf0b9bf08fd7f;p=ceph-ci.git mgr/ssh: Install SSH public key in Vagrantfile box fails The current implementation to copy the host users SSH public key into the Vagrant box does not work with Vagrant 2.2.6. Signed-off-by: Volker Theile --- diff --git a/src/pybind/mgr/ssh/Vagrantfile b/src/pybind/mgr/ssh/Vagrantfile index 84644ffd3d2..e041afe11d6 100644 --- a/src/pybind/mgr/ssh/Vagrantfile +++ b/src/pybind/mgr/ssh/Vagrantfile @@ -23,11 +23,11 @@ Vagrant.configure("2") do |config| end end - config.vm.provision "shell" do |s| - ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip - s.inline = "echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys" - s.inline = "sudo cp -r /home/vagrant/.ssh /root/.ssh" - end + config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/id_rsa.pub" + config.vm.provision "shell", inline: <<-SHELL + cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys + sudo cp -r /home/vagrant/.ssh /root/.ssh + SHELL config.vm.provision "shell", inline: <<-SHELL sudo yum install -y yum-utils