summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2015-09-20 13:07:23 +0800
committerchenshuai@huawei.com <chenshuai@huawei.com>2015-09-20 13:07:23 +0800
commita1ca02965958c3db9cc093291188e8d6100c24d9 (patch)
treeb5f88e5de30150a37c5dbd8bf2e3e1dfc33e9547 /deploy/adapters/ansible/roles
parentab9c9cbd1c96611c5cbe56260a73524186bf72f1 (diff)
change ODL service script for Centos
JIRA: COMPASS-66 Change-Id: I0a22f9f1b78d4dc96a452e8528eb95c026360503 Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles')
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/templates/opendaylight31
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.service13
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml4
3 files changed, 33 insertions, 15 deletions
diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight b/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight
new file mode 100755
index 00000000..90a267d6
--- /dev/null
+++ b/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight
@@ -0,0 +1,31 @@
+#!/bin/bash
+# chkconfig: 345 98 2
+# description: ODL controller
+# OpenDaylight service controller script
+export JAVA_HOME=/usr/lib/jvm/java-8-oracle
+USER=odl
+
+cd /opt/opendaylight-0.3.0
+case "$1" in
+ start)
+ /bin/su -m $USER -s /bin/bash -c ./bin/start
+ ;;
+ stop)
+ /bin/su -m $USER -s /bin/bash -c ./bin/stop
+ ;;
+ status)
+ PID=`ps aux | grep java | grep karaf | awk '{print $2}'`
+ if test -z $PID
+ then
+ echo "ODL is down..."
+ exit 1
+ else
+ echo "ODL is running... PID $PID"
+ exit 0
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status}"
+ exit 1
+ ;;
+esac
diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.service b/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.service
deleted file mode 100755
index a4adeeec..00000000
--- a/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=OpenDaylight SDN Controller
-Documentation=https://wiki.opendaylight.org/view/Main_Page http://www.opendaylight.org/
-After=network.service
-
-[Service]
-Type=forking
-ExecStart=/opt/opendaylight-0.3.0/bin/start
-User=odl
-Group=odl
-
-[Install]
-WantedBy=multi-user.target
diff --git a/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml b/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml
index c0dfede1..c125f89e 100755
--- a/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml
@@ -9,5 +9,5 @@ compute_packages:
service_file:
- src: opendaylight.service
- dst: /usr/lib/systemd/system/opendaylight.service
+ src: opendaylight
+ dst: /etc/init.d/opendaylight