From e1ee5d396d3a77245cac56b86b0d29fe8188ae24 Mon Sep 17 00:00:00 2001 From: James Laska Date: Wed, 30 Mar 2016 09:09:07 -0400 Subject: [PATCH] Don't manage mongo in ansible-tower-service script Connect #1290 --- tools/scripts/ansible-tower-service | 49 +++++++++-------------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/tools/scripts/ansible-tower-service b/tools/scripts/ansible-tower-service index f366f61e8f..1d2f2beec4 100755 --- a/tools/scripts/ansible-tower-service +++ b/tools/scripts/ansible-tower-service @@ -13,29 +13,8 @@ fi service_action() { SERVICES=$TOWER_SERVICES - # When determining whether mongod is required, postgres is required. The - # following ensures mongod is started after postgres, and stopped before - # postgres. - case ${1} in - start|status) - SERVICES="$SERVICES mongod" - ;; - stop) - SERVICES="mongod $SERVICES" - ;; - esac - for svc in ${SERVICES}; do - # Determine whether mongod is needed - if [[ ${svc} == mongod ]]; then - tower-manage uses_mongo --local 2> /dev/null >/dev/null - # if mongod is not required, break - if [ $? -ne 0 ]; then - continue - fi - fi - service ${svc} $1 this_return=$? if [ $this_return -gt $worst_return ]; then @@ -43,7 +22,7 @@ service_action() { fi # Allow supervisor time to cleanup child pids (ubuntu only) if [[ ${svc} == supervisor* && ${1} == stop && -e /etc/debian_version ]]; then - S_PID=$(pidof -x supervisord) + S_PID=$(pidof -x supervisord) echo "Waiting to allow supervisor time to cleanup ... pid ${S_PID}" if [ "${S_PID}" ]; then i=0 @@ -76,22 +55,22 @@ case "$1" in usage ;; start) - echo "Starting Tower" - service_action start - ;; + echo "Starting Tower" + service_action start + ;; stop) - echo "Stopping Tower" - service_action stop - ;; + echo "Stopping Tower" + service_action stop + ;; restart) - echo "Restarting Tower" - service_action stop - service_action start - ;; + echo "Restarting Tower" + service_action stop + service_action start + ;; status) - echo "Showing Tower Status" - service_action status - ;; + echo "Showing Tower Status" + service_action status + ;; *) usage worst_return=1