summaryrefslogtreecommitdiffstats
path: root/ci/generate-admin-rc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/generate-admin-rc.sh')
-rwxr-xr-xci/generate-admin-rc.sh25
1 files changed, 17 insertions, 8 deletions
diff --git a/ci/generate-admin-rc.sh b/ci/generate-admin-rc.sh
index e1e6bc9..6767fab 100755
--- a/ci/generate-admin-rc.sh
+++ b/ci/generate-admin-rc.sh
@@ -10,16 +10,14 @@
cd $(dirname "$0")
-if [ ! -d job ]
-then
- mkdir job
-fi
+mkdir -p job
SSH_KEY=""
+CA_CERT=""
INSTALLER="$(./detect_installer.sh)"
case $INSTALLER in
joid)
- OS_AUTH_URL=http://`juju status keystone | grep public | awk '{print $2}'`:5000/v2.0
+ OS_AUTH_URL=http://$(juju status keystone | grep public | awk '{print $2}'):5000/v2.0
OS_USERNAME=admin
OS_PASSWORD=openstack
cat << EOF > job/openstack.rc
@@ -31,12 +29,23 @@ export OS_PROJECT_NAME=admin
EOF
;;
fuel)
- INSTALLER_IP=$(sudo virsh domifaddr cfg01 | grep ipv4 | awk '{print $4}' | cut -d/ -f1)
+ INSTALLER_IP=$(sudo virsh net-dumpxml mcpcontrol | grep 'cfg01' | cut -d"'" -f6)
+ if [ -z "${INSTALLER_IP}" ] ; then
+ echo "Could not find FUEL installer IP"
+ exit 1
+ fi
export BRANCH="${BRANCH:-master}"
+ export BUILD_TAG="${BUILD_TAG:-baremetal}"
SSH_KEY="-s /var/lib/opnfv/mcp.rsa"
+ mkdir -p ../docker-compose/certs
+ CA_CERT="-o ../docker-compose/certs/mcp_os_cacert"
;;
apex)
INSTALLER_IP=$(sudo virsh domifaddr undercloud | grep ipv4 | awk '{print $4}' | cut -d/ -f1)
+ if [ -z "${INSTALLER_IP}" ] ; then
+ echo "Could not find Apex installer IP"
+ exit 1
+ fi
;;
*)
echo "Unknown installer ${INSTALLER}"
@@ -45,12 +54,12 @@ esac
if [ ! -z "${INSTALLER_IP}" ]
then
- CMD="./job/releng/utils/fetch_os_creds.sh -i $INSTALLER -a $INSTALLER_IP $SSH_KEY -d job/openstack.rc"
+ CMD="./job/releng/utils/fetch_os_creds.sh -i $INSTALLER -a $INSTALLER_IP $CA_CERT $SSH_KEY -d job/openstack.rc"
echo $CMD
$CMD
echo export OS_PROJECT_NAME=admin >> job/openstack.rc
fi
-grep "export" job/openstack.rc | sed "s/export //" > job/admin.rc
+awk '/export / { gsub(/"/, x); print $2}' job/openstack.rc > job/admin.rc
echo "INSTALLER_TYPE=${INSTALLER}" >> job/admin.rc