mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Add support for customizing managed tower services
Allows for overriding the services managed by the ansible-tower initscript.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user