From 3c98c8f764c0f9b8e69af038024884f7f082e7ee Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 16 Sep 2020 17:34:15 +0200 Subject: [PATCH] scripts/vagrant: unset private_key_file when password auth is used The main purpose of this is to force vagrant into using its own ssh keys when password authentication is requested. Normally, when ssh.password is defined, vagrant will attempt to inject its own ssh key, by using provided password first, and re-use the key for the new ssh session to provision the VM. However, some vagrant boxes may come with their own embedded Vagrantfiles which define custom ssh keys. If password auth is requested for such boxes, vagrant will not use its own key, nor the ones that may be defined by the vagrant box. Instead, it will fallback to interactive, password authentication. From the CI pool perspective this is not desirable. On other note, this ties to the ongoing work of building indepdent images for the CI where vagrant boxes will be deployed with a custom ssh key alredy provided inside the box. Related work: trello.com/c/gAfo9mH1/208-vagrant-improvements-box-packaging trello.com/c/9Dxp2Y9c/248-packaging-centos78-and-freebsd1112-with-packer Change-Id: I49035b426519d9b24bcdab573d335ee622130560 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4283 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- scripts/vagrant/Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/Vagrantfile index f868e9d01..a77ddb979 100644 --- a/scripts/vagrant/Vagrantfile +++ b/scripts/vagrant/Vagrantfile @@ -182,6 +182,7 @@ def setup_ssh(config) if ENV['VAGRANT_PASSWORD_AUTH'] == "1" config.ssh.username = "vagrant" config.ssh.password = "vagrant" + config.ssh.private_key_path = nil end end