From da42199decb22cbc0db97f8bd8a56f477d22e4f1 Mon Sep 17 00:00:00 2001 From: Ian Main Date: Fri, 8 Dec 2017 19:49:43 +0000 Subject: [PATCH] Generate a default keypair for nova. This was missing from the post configuration. Need a default keypair for CI. Change-Id: I79ce491890e0b3b7c6ca6f27c762cf8687b1428f --- extraconfig/post_deploy/undercloud_post.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/extraconfig/post_deploy/undercloud_post.sh b/extraconfig/post_deploy/undercloud_post.sh index 151e0e076f..321d41f384 100755 --- a/extraconfig/post_deploy/undercloud_post.sh +++ b/extraconfig/post_deploy/undercloud_post.sh @@ -122,6 +122,20 @@ if [ "$(hiera nova_api_enabled)" = "true" ]; then openstack quota set --cores -1 --instances -1 --ram -1 $(openstack project show admin | awk '$2=="id" {print $4}') fi + +# Set up a default keypair. +if [ ! -e $HOMEDIR/.ssh/id_rsa ]; then + sudo -E -u $USERNAME ssh-keygen -t rsa -N '' -f $HOMEDIR/.ssh/id_rsa +fi + +if openstack keypair show default; then + echo Keypair already exists. +else + echo Creating new keypair. + openstack keypair create 'default' < $HOMEDIR/.ssh/id_rsa.pub +fi + + # MISTRAL WORKFLOW CONFIGURATION if [ "$(hiera mistral_api_enabled)" = "true" ]; then # load workflows