From 955af6aa85b22187c69873c63360cc7b50b1c358 Mon Sep 17 00:00:00 2001 From: James Laska Date: Mon, 24 Nov 2014 16:28:13 -0500 Subject: [PATCH] Add support for customizing managed tower services Allows for overriding the services managed by the ansible-tower initscript. --- tools/scripts/ansible-tower | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/scripts/ansible-tower b/tools/scripts/ansible-tower index f124ac5009..049cc32bd4 100755 --- a/tools/scripts/ansible-tower +++ b/tools/scripts/ansible-tower @@ -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