diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-09-10 21:34:32 +0200 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-09-11 17:57:50 +0000 |
commit | cad161204a2d64f94be574f27fed92ac24c059ca (patch) | |
tree | a3f367426a1024513e76199065dd7d619be819af /utils | |
parent | a8e3451b433586b477fbe2eb939848bf97a430f4 (diff) |
fuel, armband: Remove SALT_MASTER_IP param
Fuel@OPNFV mcpcontrol network (equiv to old admin/PXE net) has been
configured to use 192.168.10.0/24 during E release cycle.
However, due to overlapping with Ericsson-pod1 networks, we decided
to re-use the old CIDR Fuel used before E release (10.20.0.0/24).
This allows reusing the INSTALLER_IP param instead of recently added
SALT_MASTER_IP param.
Current change refactors all usage of SALT_MASTER_IP in favor of old
INSTALLER_IP, thus reducing complexity and providing a familiar env
to leagcy Fuel users.
JIRA: FUEL-285
Change-Id: I1e89cca08ce4cb9bf3a82a06043c91ee26aa0794
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/fetch_os_creds.sh | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh index 3bc66f942..0873a6832 100755 --- a/utils/fetch_os_creds.sh +++ b/utils/fetch_os_creds.sh @@ -74,9 +74,6 @@ dest_path=${dest_path:-$HOME/opnfv-openrc.sh} os_cacert=${os_cacert:-$HOME/os_cacert} installer_type=${installer_type:-$INSTALLER_TYPE} installer_ip=${installer_ip:-$INSTALLER_IP} -if [ "${installer_type}" == "fuel" ] && [ "${BRANCH}" == "master" ]; then - installer_ip=${SALT_MASTER_IP} -fi if [ -z $dest_path ] || [ -z $installer_type ] || [ -z $installer_ip ]; then usage @@ -97,28 +94,31 @@ ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" # Start fetching the files info "Fetching rc file..." if [ "$installer_type" == "fuel" ]; then - verify_connectivity $installer_ip - if [ "${BRANCH}" == "master" ]; then - ssh_key=${ssh_key:-$SSH_KEY} - if [ -z $ssh_key ] || [ ! -f $ssh_key ]; then + verify_connectivity "${installer_ip}" + # stable/danube uses old Fuel, requires user/pass; new Fuel uses keypair + if [[ ! "${BRANCH}" =~ "danube" ]]; then + ssh_user="ubuntu" + ssh_key="${ssh_key:-$SSH_KEY}" + if [ -z "$ssh_key" ] || [ ! -f "$ssh_key" ]; then error "Please provide path to existing ssh key for mcp deployment." exit 2 fi ssh_options+=" -i ${ssh_key}" # retrieving controller vip - controller_ip=$(ssh 2>/dev/null ${ssh_options} ubuntu@${installer_ip} \ - "sudo salt --out txt 'ctl*' pillar.get _param:openstack_control_address | awk '{print \$2; exit}'" | \ - sed 's/ //g') &> /dev/null + controller_ip=$(ssh 2>/dev/null ${ssh_options} "${ssh_user}@${installer_ip}" \ + "sudo salt --out yaml 'ctl*' pillar.get _param:openstack_control_address | \ + awk '{print \$2; exit}'") &> /dev/null - info "... from controller $controller_ip..." - ssh ${ssh_options} ubuntu@${controller_ip} "sudo cat /root/keystonercv3" > $dest_path + info "... from controller ${controller_ip} ..." + ssh ${ssh_options} "${ssh_user}@${controller_ip}" \ + "sudo cat /root/keystonercv3" > "${dest_path}" - if [[ $BUILD_TAG =~ "baremetal" ]]; then - ssh ${ssh_options} ubuntu@${installer_ip} "cat /etc/ssl/certs/os_cacert" > $os_cacert + if [[ "${BUILD_TAG}" =~ "baremetal" ]]; then + ssh ${ssh_options} "${ssh_user}@${installer_ip}" \ + "cat /etc/ssl/certs/os_cacert" > "${os_cacert}" fi else - #ip_fuel="10.20.0.2" env=$(sshpass -p r00tme ssh 2>/dev/null ${ssh_options} root@${installer_ip} \ 'fuel env'|grep operational|head -1|awk '{print $1}') &> /dev/null if [ -z $env ]; then |