From 7cd016879c4be065a3f968e06ee5d4b360b8833c Mon Sep 17 00:00:00 2001 From: Ankur Kothiwal Date: Mon, 12 Jul 2021 11:33:09 +0530 Subject: [PATCH] update Vagrantfile to create ssh rsa keys if they don't already exist Signed-off-by: Ankur Kothiwal --- contribution/vagrant/Vagrantfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contribution/vagrant/Vagrantfile b/contribution/vagrant/Vagrantfile index 7fdd5ffeb8..e70a670b0b 100644 --- a/contribution/vagrant/Vagrantfile +++ b/contribution/vagrant/Vagrantfile @@ -8,6 +8,16 @@ else VM_NAME = "kubearmor-dev" end +system(" + if [ #{ARGV[0]} = 'up' ]; then + if [ ! -f ~/.ssh/id_rsa ] + then + echo '~/.ssh/id_rsa keys does not exist.' + ssh-keygen -t rsa -f ~/.ssh/id_rsa + fi + fi +") + Vagrant.configure("2") do |config| # Need updated vbguest and reload for latest kernel if ENV['NETNEXT'] == "1" then