Generate SSH key pair when it is missing

Depends-On: https://review.opendev.org/760088/
Change-Id: Ie17cd336d9273912192e9f3477e1775b4569ad7a
This commit is contained in:
Federico Ressi 2020-10-23 12:51:13 +02:00
parent b0563a4ba4
commit 341a3db161
3 changed files with 23 additions and 6 deletions

8
Vagrantfile vendored
View File

@ -39,7 +39,7 @@ TOX_ENVLIST = ENV.fetch('TOX_ENVLIST', '')
TOX_EXTRA_ARGS = ENV.fetch('TOX_EXTRA_ARGS', '--notest')
# Allow to switch configuration
DEVSTACK_CONF_NAME = ENV.fetch('DEVSTACK_CONF_NAME', 'ovs')
DEVSTACK_CONF_NAME = ENV.fetch('DEVSTACK_CONF_NAME', 'ovn')
DEVSTACK_LOCAL_CONF_FILE = ENV.fetch(
'DEVSTACK_LOCAL_CONF_FILE',
@ -57,10 +57,16 @@ DEVSTACK_PROJECTS = {
'src_dir' => ENV.fetch("DEVSTACK_PLUGIN_TOBIKO_SRC_DIR", VAGRANTFILE_DIR),
},
# Local directory from where look for OpenStack requirements project files
'requirements' => {
'src_dir' => ENV.fetch("REQUIREMENTS_DIR", "#{PROJECTS_DIR}/requirements"),
},
# Local directory from where looking for Tobiko project files
'tobiko' => {
'src_dir' => ENV.fetch("TOBIKO_SRC_DIR", "#{PROJECTS_DIR}/tobiko"),
},
}

View File

@ -149,11 +149,20 @@ function configure_tobiko_nova {
echo_summary "Write [nova] section to ${TOBIKO_CONF_FILE}"
local tobiko_conf_file=$1
# Write key_file
local key_file=${TOBIKO_NOVA_KEY_FILE:-}
if [ "${key_file}" != "" ]; then
iniset "${tobiko_conf_file}" nova key_file "${key_file}"
fi
(
cd $(dirname "${tobiko_conf_file}")
local key_file=${TOBIKO_NOVA_KEY_FILE}
if [ "${key_file}" != "" ]; then
iniset "${tobiko_conf_file}" nova key_file "${key_file}"
else
# Use the default keyfile name
key_file=~/.ssh/id_rsa
fi
if ! [ -r "${key_file}" ]; then
mkdir -p $(dirname "${key_file}")
ssh-keygen -f "${key_file}" -N ""
fi
)
}

View File

@ -16,6 +16,8 @@ disable_service tempest
# Configure Neutron -----------------------------------------------------------
enable_plugin neutron https://opendev.org/openstack/neutron.git
HOST_IP=192.168.33.10
IP_VERSION=4