diff options
author | Nauman_Ahad <Nauman_Ahad@dell.com> | 2015-12-31 19:37:40 +0500 |
---|---|---|
committer | Nauman_Ahad <Nauman_Ahad@dell.com> | 2015-12-31 19:37:40 +0500 |
commit | 5bad9cc14d4c7624ea44dd1e911f00be290cb41e (patch) | |
tree | af2e88c0b7d2b51d5f37d1883d3754ad3368e18d | |
parent | 9dec9cdeaafb8c336dda3d61a92542ff63e1c6ff (diff) |
Scripts for inserting QTIP.pub key on installed nodes
1st script takes in the installer type and installer ip
2nd script to be called by the qtip framework while providing
the destionation node ip as an argument
Change-Id: I2b6b2828bc0f00a38ea2998fb389435fd5963cae
Signed-off-by: Nauman_Ahad <Nauman_Ahad@dell.com>
-rwxr-xr-x | data/get_env_info.sh | 21 | ||||
-rwxr-xr-x | data/qtip_creds.sh | 23 |
2 files changed, 44 insertions, 0 deletions
diff --git a/data/get_env_info.sh b/data/get_env_info.sh new file mode 100755 index 00000000..98ca68a6 --- /dev/null +++ b/data/get_env_info.sh @@ -0,0 +1,21 @@ +#! /bin/bash + +usage() { + echo "usage $0 -n <installer_type> -i <installer_ip>" +} + + + +while getopts ":n:i:" optchar; do + case "${optchar}" in + n) + export INSTALLER_TYPE=${OPTARG};; + + i) + export INSTALLER_IP=${OPTARG};; + + *) + echo "Incorrect usage" + usage ;; + esac +done diff --git a/data/qtip_creds.sh b/data/qtip_creds.sh new file mode 100755 index 00000000..e2619d64 --- /dev/null +++ b/data/qtip_creds.sh @@ -0,0 +1,23 @@ +#! /bin/bash + +DEST_IP=$1 +echo $INSTALLER_TYPE +echo $INSTALLER_IP + +case "$INSTALLER_TYPE" in + apex) + PSWD="vagrant";; + fuel) + PSWD="r00tme";; + compass) + PSWD="compass";; + joid) + PSWD="joid";; + *) + echo "Unkown installer $INSTALLER_TYPE specified";; +esac + +sshoptions="-o StrictHostKeyChecking=no" +sshpass -p $PSWD scp $sshoptions QtipKey.pub 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.pub" + |