Add support for customizing managed tower services

Allows for overriding the services managed by the ansible-tower
initscript.
This commit is contained in:
James Laska 2014-11-24 16:28:13 -05:00
parent c4bdf0d936
commit 955af6aa85

View File

@ -16,15 +16,20 @@
# 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 redis-server apache2 supervisor)
# Default configured services
if [ -e /etc/debian_version ]; then
SERVICES="postgresql redis-server apache2 supervisor"
TOWER_CONFIG="/etc/default/tower"
else
SERVICES=(postgresql redis httpd supervisord)
SERVICES="postgresql redis httpd supervisord"
TOWER_CONFIG="/etc/sysconfig/tower"
fi
# Load any configuration
[ -e "${TOWER_CONFIG}" ] && . "${TOWER_CONFIG}"
service_action() {
for svc in ${SERVICES[@]}; do
for svc in ${SERVICES}; do
service ${svc} $1
this_return=$?
if [ $this_return -gt $worst_return ]; then