diff options
-rwxr-xr-x | data/qtip_creds.sh | 8 | ||||
-rwxr-xr-x | get_env_info.sh | 21 |
2 files changed, 23 insertions, 6 deletions
diff --git a/data/qtip_creds.sh b/data/qtip_creds.sh index bcd4c246..bf316b4d 100755 --- a/data/qtip_creds.sh +++ b/data/qtip_creds.sh @@ -6,19 +6,21 @@ echo $INSTALLER_IP sshoptions="-o StrictHostKeyChecking=no" case "$INSTALLER_TYPE" in apex) - PSWD="vagrant" + scp $sshoptions -i $APEX_KEY ./data/QtipKey.pub stack@$INSTALLER_IP:/home/stack + scp $sshoptions -i $APEX_KEY ./data/QtipKey stack@$INSTALLER_IP:/home/stack + ssh $sshoptions -i $APEX_KEY stack@$INSTALLER_IP "ssh-copy-id $sshoptions -i /home/stack/QtipKey.pub heat-admin@$DEST_IP && rm -rf /home/stack/QtipKey && rm -rf /home/stack/QtipKey.pub" ;; fuel) PSWD="r00tme" sshpass -p $PSWD scp $sshoptions ./data/QtipKey.pub root@$INSTALLER_IP:/root sshpass -p $PSWD scp $sshoptions ./data/QtipKey root@$INSTALLER_IP:/root - sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id -i /root/QtipKey.pub root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub" + sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id $sshoptions -i /root/QtipKey.pub root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub" ;; compass) PSWD="root" sshpass -p $PSWD scp $sshoptions ./data/QtipKey.pub root@$INSTALLER_IP:/root sshpass -p $PSWD scp $sshoptions ./data/QtipKey root@$INSTALLER_IP:/root - sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id -i /root/QtipKey.pub root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub" + sshpass -p $PSWD ssh $sshoptions root@$INSTALLER_IP "ssh-copy-id $sshoptions -i /root/QtipKey.pub root@$DEST_IP && rm -rf /root/QtipKey && rm -rf /root/QtipKey.pub" ;; joid) PSWD="joid";; diff --git a/get_env_info.sh b/get_env_info.sh index 6a4dd530..2fb0d22b 100755 --- a/get_env_info.sh +++ b/get_env_info.sh @@ -1,22 +1,37 @@ #! /bin/bash usage() { - echo "usage $0 -n <installer_type> -i <installer_ip>" + echo "usage $0 -n <installer_type> -i <installer_ip> -k <key incase of apex>" } -while getopts ":n:i:" optchar; do +while getopts ":n:i:k:" optchar; do case "${optchar}" in n) - export INSTALLER_TYPE=${OPTARG};; + export INSTALLER_TYPE=${OPTARG};; i) export INSTALLER_IP=${OPTARG};; + k) + export APEX_KEY=${OPTARG};; + *) echo "Incorrect usage" usage ;; esac done + +if [ $INSTALLER_TYPE == "apex" ] + then + if [ -z $APEX_KEY ] + then + echo "Please provide the the key to access the APEX Instack VM" + usage + exit 1 + fi +fi + + ./data/fetch_os_creds.sh -d ./opnfv-creds.sh |