Don't manage mongo in ansible-tower-service script

Connect #1290
This commit is contained in:
James Laska 2016-03-30 09:09:07 -04:00
parent fc5d497ce6
commit e1ee5d396d

View File

@ -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