1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00
awx/tools/scripts/ansible-tower
2014-07-31 10:40:11 -04:00

54 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#
# ansible-tower
#
# chkconfig: - 20 80
# description: support init to manage tower and its related services
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: support init to manage tower and its related services
# Description: Ansible Tower provides an easy-to-use UI and dashboard, role-based access control and more for your Ansible initiative
### END INIT INFO
if [ -e /etc/debian_version ]
then
SERVICES=(postgresql rabbitmq-server apache2 supervisor)
else
SERVICES=(postgresql rabbitmq-server httpd supervisord)
fi
service_action() {
for svc in ${SERVICES[@]}; do
/etc/init.d/${svc} $1
done
}
case "$1" in
start)
echo "Starting Tower"
service_action start
;;
stop)
echo "Stopping Tower"
service_action stop
;;
restart)
echo "Restarting Tower"
service_action stop
service_action start
;;
status)
echo "Showing Tower Status"
service_action status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
esac