From d47d2f57000b60e11e3294af954aeb5452309f33 Mon Sep 17 00:00:00 2001 From: James Laska Date: Tue, 25 Nov 2014 09:22:02 -0500 Subject: [PATCH] Add ansible-tower.{default,sysconfig} script The 'ansible-tower' service script now comes with an additional file: /etc/{default,sysconfig}/ansible-tower This file is used to specify the services managed by the 'ansible-tower' service script. The presence of this file allows admins (or the setup playbook) to customize the services managed. For example, when using a remote postgres server, one would remove 'postgresql' from the list of tower managed services. --- Makefile | 1 + tools/scripts/ansible-tower | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5845f5ad6f..23c57dc249 100644 --- a/Makefile +++ b/Makefile @@ -312,6 +312,7 @@ rpm-build/$(SDIST_TAR_FILE): dist/$(SDIST_TAR_FILE) mkdir -p rpm-build cp packaging/rpm/$(NAME).spec rpm-build/ cp packaging/rpm/$(NAME).te rpm-build/ + cp packaging/rpm/$(NAME).sysconfig rpm-build/ cp packaging/remove_tower_source.py rpm-build/ if [ "$(OFFICIAL)" != "yes" ] ; then \ (cd dist/ && tar zxf $(SDIST_TAR_FILE)) ; \ diff --git a/tools/scripts/ansible-tower b/tools/scripts/ansible-tower index 049cc32bd4..3e3eb86991 100755 --- a/tools/scripts/ansible-tower +++ b/tools/scripts/ansible-tower @@ -18,18 +18,16 @@ # Default configured services if [ -e /etc/debian_version ]; then - SERVICES="postgresql redis-server apache2 supervisor" - TOWER_CONFIG="/etc/default/tower" + TOWER_CONFIG="/etc/default/ansible-tower" else - SERVICES="postgresql redis httpd supervisord" - TOWER_CONFIG="/etc/sysconfig/tower" + TOWER_CONFIG="/etc/sysconfig/ansible-tower" fi -# Load any configuration +# Load default configuration [ -e "${TOWER_CONFIG}" ] && . "${TOWER_CONFIG}" service_action() { - for svc in ${SERVICES}; do + for svc in ${TOWER_SERVICES}; do service ${svc} $1 this_return=$? if [ $this_return -gt $worst_return ]; then