summaryrefslogtreecommitdiffstats
path: root/jjb/puppet-fdio
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2016-11-21 15:56:52 -0500
committerFeng Pan <fpan@redhat.com>2016-11-21 15:56:52 -0500
commit1a4800952c56743ac8070d3051f423b7bf3bb8c5 (patch)
treed307915b9afe3444f9c6749744da2ce1d07ad3c6 /jjb/puppet-fdio
parent4cf6c5580ed386c070fcc72465b703f145e2ee9e (diff)
puppet-fdio: check for public key file
Change-Id: I9738c51ea4a473658145979d98d8dd16979aee41 Signed-off-by: Feng Pan <fpan@redhat.com>
Diffstat (limited to 'jjb/puppet-fdio')
-rw-r--r--jjb/puppet-fdio/puppet-fdio.yaml6
1 files changed, 5 insertions, 1 deletions
diff --git a/jjb/puppet-fdio/puppet-fdio.yaml b/jjb/puppet-fdio/puppet-fdio.yaml
index d34f2c17d..82edfea40 100644
--- a/jjb/puppet-fdio/puppet-fdio.yaml
+++ b/jjb/puppet-fdio/puppet-fdio.yaml
@@ -150,8 +150,12 @@
echo "Match address ::1" | sudo tee -a /etc/ssh/sshd_config
echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
mkdir -p .ssh
- if [ ! -f ~/.ssh/id_rsa ]; then
+ if [ ! -f ~/.ssh/id_rsa.pub ]; then
+ if [ -f ~/.ssh/id_rsa ]; then
+ ssh-keygen -y -f ~/.ssh/id_rsa -b 2048 -P "" > ~/.ssh/id_rsa.pub
+ else
ssh-keygen -f ~/.ssh/id_rsa -b 2048 -P ""
+ fi
fi
sudo mkdir -p /root/.ssh
cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys