+ # Fuel virtual need a fix
+
+ if [ "$DEPLOY_TYPE" == "virt" ]; then
+ echo "INFO: Changing: internalURL -> publicURL in openrc"
+ sed -i 's/internalURL/publicURL/' $dest_path
+ fi
+
+elif [ "$installer_type" == "apex" ]; then
+ 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 "Fetching rc file 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 $dest_path
+
+elif [ "$installer_type" == "compass" ]; then
+ verify_connectivity $installer_ip
+ controller_ip=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \
+ 'mysql -ucompass -pcompass -Dcompass -e"select * from cluster;"' \
+ | awk -F"," '{for(i=1;i<NF;i++)if($i~/\"host[1-5]\"/) {print $(i+1);break;}}' \
+ | grep -oP "\d+.\d+.\d+.\d+")
+
+ if [ -z $controller_ip ]; then
+ error "The controller $controller_ip is not up. Please check that the POD is correctly deployed."
+ fi
+
+ info "Fetching rc file from controller $controller_ip..."
+ sshpass -p root ssh 2>/dev/null $ssh_options root@${installer_ip} \
+ "scp $ssh_options ${controller_ip}:/opt/admin-openrc.sh ." &> /dev/null
+ sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:~/admin-openrc.sh $dest_path &> /dev/null
+ echo 'export OS_REGION_NAME=regionOne' >> $dest_path
+
+ info "This file contains the mgmt keystone API, we need the public one for our rc file"
+ public_ip=$(sshpass -p root ssh $ssh_options root@${installer_ip} \
+ "ssh ${controller_ip} 'source /opt/admin-openrc.sh; openstack endpoint show identity '" \
+ | grep publicurl | awk '{print $4}')
+ info "public_ip: $public_ip"
+