X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Ffetch_os_creds.sh;h=4a66187e5714dcaffe750127829962171f4fa0a6;hb=f7df2d437f5b4b15d3c374da4d24b137cc672916;hp=7a79da4f44e73e03344de0c3e20b522d35cb474a;hpb=8f2dfa0d6881e43aa8f2f52b51bdaf3c64d1efb6;p=releng.git diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh index 7a79da4f4..4a66187e5 100755 --- a/utils/fetch_os_creds.sh +++ b/utils/fetch_os_creds.sh @@ -8,7 +8,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## set -o errexit -set -o nounset set -o pipefail usage() { @@ -114,8 +113,10 @@ if [ "$installer_type" == "fuel" ]; then ssh ${ssh_options} "${ssh_user}@${controller_ip}" \ "sudo cat /root/keystonercv3" > "${dest_path}" - ssh ${ssh_options} "${ssh_user}@${installer_ip}" \ - "cat /etc/ssl/certs/os_cacert" > "${os_cacert}" || touch "${os_cacert}" + if [[ ! "${DEPLOY_SCENARIO}" =~ -noha$ ]]; then + ssh ${ssh_options} "${ssh_user}@${installer_ip}" \ + "cat /etc/ssl/certs/os_cacert" > "${os_cacert}" + fi else env=$(sshpass -p r00tme ssh 2>/dev/null ${ssh_options} root@${installer_ip} \ 'fuel env'|grep operational|head -1|awk '{print $1}') &> /dev/null @@ -147,23 +148,33 @@ if [ "$installer_type" == "fuel" ]; then echo $auth_url >> $dest_path elif [ "$installer_type" == "apex" ]; then - if ! ipcalc -c $installer_ip; then - installer_ip=$(sudo virsh domifaddr undercloud | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') - if [ -z "$installer_ip" ] || ! $(ipcalc -c $installer_ip); then - echo "Unable to find valid IP for Apex undercloud: ${installer_ip}" - exit 1 - fi - fi - verify_connectivity $installer_ip + if [ -n "$RC_FILE_PATH" ]; then + echo "RC_FILE_PATH is set: ${RC_FILE_PATH}. Copying RC FILE to ${dest_path}" + sudo cp -f ${RC_FILE_PATH} ${dest_path} + else + if ! ipcalc -c $installer_ip; then + installer_ip=$(sudo virsh domifaddr undercloud | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') + if [ -z "$installer_ip" ] || ! $(ipcalc -c $installer_ip); then + echo "Unable to find valid IP for Apex undercloud: ${installer_ip}" + exit 1 + fi + fi + verify_connectivity $installer_ip - # The credentials file is located in the Instack VM (192.0.2.1) - # NOTE: This might change for bare metal deployments - info "... from Instack VM $installer_ip..." - if [ -f /root/.ssh/id_rsa ]; then - chmod 600 /root/.ssh/id_rsa - fi - sudo scp $ssh_options root@$installer_ip:/home/stack/overcloudrc.v3 $dest_path + # The credentials file is located in the Instack VM (192.0.2.1) + # NOTE: This might change for bare metal deployments + info "... from Instack VM $installer_ip..." + if [ -f /root/.ssh/id_rsa ]; then + chmod 600 /root/.ssh/id_rsa + fi + if [ "${BRANCH}" == "stable/fraser" ]; then + rc_file=overcloudrc.v3 + else + rc_file=overcloudrc + fi + sudo scp $ssh_options root@$installer_ip:/home/stack/${rc_file} $dest_path + fi elif [ "$installer_type" == "compass" ]; then if [ "${BRANCH}" == "stable/danube" ]; then verify_connectivity $installer_ip