mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 05:15:02 -02:30
Add tower meta-init script
This commit is contained in:
@@ -18,6 +18,7 @@ include awx/ui/static/js/awx.min.js
|
|||||||
include awx/ui/static/js/config.js
|
include awx/ui/static/js/config.js
|
||||||
include tools/scripts/request_tower_configuration.sh
|
include tools/scripts/request_tower_configuration.sh
|
||||||
include tools/scripts/tower_jobs
|
include tools/scripts/tower_jobs
|
||||||
|
include tools/scripts/ansible-tower
|
||||||
include COPYING
|
include COPYING
|
||||||
prune awx/public
|
prune awx/public
|
||||||
prune awx/projects
|
prune awx/projects
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -13,6 +13,7 @@ from awx import __version__
|
|||||||
build_timestamp = os.getenv("BUILD",datetime.datetime.now().strftime('-%Y%m%d%H%M'))
|
build_timestamp = os.getenv("BUILD",datetime.datetime.now().strftime('-%Y%m%d%H%M'))
|
||||||
|
|
||||||
# Paths we'll use later
|
# Paths we'll use later
|
||||||
|
sysinit = "/etc/init.d"
|
||||||
etcpath = "/etc/awx"
|
etcpath = "/etc/awx"
|
||||||
homedir = "/var/lib/awx"
|
homedir = "/var/lib/awx"
|
||||||
sharedir = "/usr/share/awx"
|
sharedir = "/usr/share/awx"
|
||||||
@@ -205,6 +206,7 @@ setup(
|
|||||||
("%s" % sharedir, ["tools/scripts/request_tower_configuration.sh",]),
|
("%s" % sharedir, ["tools/scripts/request_tower_configuration.sh",]),
|
||||||
("%s" % munin_plugin_path, ["tools/scripts/tower_jobs"]),
|
("%s" % munin_plugin_path, ["tools/scripts/tower_jobs"]),
|
||||||
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
|
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
|
||||||
|
("%s" % sysinit, ["tools/scripts/ansible-tower"]),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
options = {
|
options = {
|
||||||
|
|||||||
39
tools/scripts/ansible-tower
Executable file
39
tools/scripts/ansible-tower
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# init script to manage tower and its related services
|
||||||
|
# Copyright (c) 2014 Ansible, Inc.
|
||||||
|
# All Rights Reserved
|
||||||
|
|
||||||
|
if [ -e /etc/debian_version ]
|
||||||
|
then
|
||||||
|
SERVICES=(postgresql rabbitmq-server apache2 supervisord)
|
||||||
|
else
|
||||||
|
SERVICES=(postgresql rabbitmq-server httpd supervisord)
|
||||||
|
fi
|
||||||
|
|
||||||
|
service_action() {
|
||||||
|
for svc in ${SERVICES[@]}; do
|
||||||
|
/etc/init.d/${svc} $1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo "Starting Tower"
|
||||||
|
service_action start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo "Stopping Tower"
|
||||||
|
service_action stop
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
echo "Restarting Tower"
|
||||||
|
service_action restart
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
echo "Showing Tower Status"
|
||||||
|
service_action status
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|restart}"
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user