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 # Description: Ansible Tower provides an easy-to-use UI and dashboard, role-based access control and more for your Ansible initiative
### END INIT INFO ### END INIT INFO
if [ -e /etc/debian_version ] # Default configured services
then if [ -e /etc/debian_version ]; then
SERVICES=(postgresql redis-server apache2 supervisor) SERVICES="postgresql redis-server apache2 supervisor"
TOWER_CONFIG="/etc/default/tower"
else else
SERVICES=(postgresql redis httpd supervisord) SERVICES="postgresql redis httpd supervisord"
TOWER_CONFIG="/etc/sysconfig/tower"
fi fi
# Load any configuration
[ -e "${TOWER_CONFIG}" ] && . "${TOWER_CONFIG}"
service_action() { service_action() {
for svc in ${SERVICES[@]}; do for svc in ${SERVICES}; do
service ${svc} $1 service ${svc} $1
this_return=$? this_return=$?
if [ $this_return -gt $worst_return ]; then if [ $this_return -gt $worst_return ]; then