diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2016-01-08 15:22:20 -0500 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2016-01-08 15:22:20 -0500 |
commit | ce64c9752c1591e27ef772850f02de8a300225bb (patch) | |
tree | 34518d45eea47d79adacb30bb94fa89d25f74ba3 /bin/opssh | |
parent | 87d94dfb40f92e8858f15135b9484a1e27fd2e22 (diff) | |
parent | 029abcad0ab431ac53b680fae2938541dbaed3ce (diff) | |
download | openshift-ce64c9752c1591e27ef772850f02de8a300225bb.tar.gz openshift-ce64c9752c1591e27ef772850f02de8a300225bb.tar.bz2 openshift-ce64c9752c1591e27ef772850f02de8a300225bb.tar.xz openshift-ce64c9752c1591e27ef772850f02de8a300225bb.zip |
Merge pull request #1145 from kwoodson/metatools
Updating metadata to have clusterid, id, ip, and private ip.
Diffstat (limited to 'bin/opssh')
-rwxr-xr-x | bin/opssh | 49 |
1 files changed, 34 insertions, 15 deletions
@@ -13,6 +13,8 @@ Options: -p PAR, --par=PAR max number of parallel threads (OPTIONAL) --outdir=OUTDIR output directory for stdout files (OPTIONAL) --errdir=ERRDIR output directory for stderr files (OPTIONAL) + -c CLUSTER, --cluster CLUSTER + which cluster to use -e ENV, --env ENV which environment to use -t HOST_TYPE, --host-type HOST_TYPE which host type to use @@ -45,9 +47,9 @@ fi # See if ohi is installed if ! which ohi &>/dev/null ; then - echo "ERROR: can't find ohi (OpenShift Host Inventory) on your system, please either install the openshift-ansible-bin package, or add openshift-ansible/bin to your path." + echo "ERROR: can't find ohi (OpenShift Host Inventory) on your system, please either install the openshift-ansible-bin package, or add openshift-ansible/bin to your path." - exit 10 + exit 10 fi PAR=200 @@ -64,12 +66,23 @@ while [ $# -gt 0 ] ; do shift # get past the value of the option ;; + -c) + shift # get past the option + CLUSTER=$1 + shift # get past the value of the option + ;; + -e) shift # get past the option ENV=$1 shift # get past the value of the option ;; + --v3) + OPENSHIFT_VERSION="--v3" + shift # get past the value of the option + ;; + --timeout) shift # get past the option TIMEOUT=$1 @@ -106,20 +119,26 @@ while [ $# -gt 0 ] ; do done # Get host list from ohi -if [ -n "$ENV" -a -n "$HOST_TYPE" ] ; then - HOSTS="$(ohi -t "$HOST_TYPE" -e "$ENV" 2>/dev/null)" - OHI_ECODE=$? -elif [ -n "$ENV" ] ; then - HOSTS="$(ohi -e "$ENV" 2>/dev/null)" - OHI_ECODE=$? -elif [ -n "$HOST_TYPE" ] ; then - HOSTS="$(ohi -t "$HOST_TYPE" 2>/dev/null)" +CMD="" +if [ -n "$CLUSTER" ] ; then + CMD="$CMD -c $CLUSTER" +fi + +if [ -n "$ENV" ] ; then + CMD="$CMD -e $ENV" +fi + +if [ -n "$HOST_TYPE" ] ; then + CMD="$CMD -t $HOST_TYPE" +fi + +if [ -n "$OPENSHIFT_VERSION" ] ; then + CMD="$CMD $OPENSHIFT_VERSION" +fi + +if [ -n "$CMD" ] ; then + HOSTS="$(ohi $CMD 2>/dev/null)" OHI_ECODE=$? -else - echo - echo "Error: either -e or -t must be specified" - echo - exit 10 fi if [ $OHI_ECODE -ne 0 ] ; then |