summaryrefslogtreecommitdiffstats
path: root/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates
diff options
context:
space:
mode:
Diffstat (limited to 'framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates')
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/centos/onos.erb52
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/cluster.json.erb20
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/debian/onos.conf.erb31
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb6
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/tablets.json.erb69
5 files changed, 178 insertions, 0 deletions
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/centos/onos.erb b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/centos/onos.erb
new file mode 100644
index 00000000..d878d4fc
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/centos/onos.erb
@@ -0,0 +1,52 @@
+#!/bin/bash
+# chkconfig: 345 98 2
+# description: Open Network Operating System
+# onos Startup script for onos
+# processname: onos
+
+prog=onos
+export JAVA_HOME=/usr/lib/jvm/java-8-oracle
+export ONOS_APPS=<%= @onos_extra_features -%>
+
+cd /opt/onos/bin/
+start(){
+ echo $"Starting $prog..."
+ ./onos-service &
+ }
+stop(){
+ PID=`ps aux | grep java | grep karaf | awk '{print $2}'`
+ echo $"Stopping $prog $PID"
+ kill -9 $PID
+ sleep 10
+ }
+status(){
+ PID=`ps aux | grep java | grep karaf | awk '{print $2}'`
+ if test -z $PID
+ then
+ echo "onos stop/waiting"
+ exit 1
+ else
+ echo "onos start/running, process $PID."
+ exit 0
+ fi
+ }
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ status)
+ status
+ ;;
+ *)
+ echo "Please use: $0 {start|stop|status}"
+ exit 1
+ ;;
+esac
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/cluster.json.erb b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/cluster.json.erb
new file mode 100644
index 00000000..7ca41733
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/cluster.json.erb
@@ -0,0 +1,20 @@
+{"ipPrefix": "192.168.0.*",
+ "nodes": [
+ <% index = 1 -%>
+ <%- @manager_ip.each do |ip| -%>
+ <%- if index == @manager_ip.size -%>
+ {
+ "ip": "<%= ip -%>",
+ "id": "<%= ip -%>",
+ "tcpPort": 9876
+ }
+ <%- else -%>
+ {
+ "ip": "<%= ip -%>",
+ "id": "<%= ip -%>",
+ "tcpPort": 9876
+ },
+ <%- end -%>
+ <%- index = index + 1 -%>
+ <%- end -%>
+]}
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/debian/onos.conf.erb b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/debian/onos.conf.erb
new file mode 100644
index 00000000..1387a848
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/debian/onos.conf.erb
@@ -0,0 +1,31 @@
+description "Open Network Operating System"
+author "ON.Lab"
+
+start on (net-device-up
+ and local-filesystems
+ and runlevel [2345])
+stop on runlevel [016]
+
+console output
+kill timeout 60
+respawn
+
+env LANG=en_US.UTF-8
+env JAVA_HOME=/usr/lib/jvm/java-8-oracle;
+pre-stop script
+ /opt/onos/bin/onos halt 2>>/opt/onos/var/stderr.log
+ sleep 1
+end script
+
+script
+ export J2SDKDIR=/usr/lib/jvm/java-8-oracle;
+ export J2REDIR=/usr/lib/jvm/java-8-oracle/jre;
+ export PATH=$PATH:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin;
+ export JAVA_HOME=/usr/lib/jvm/java-8-oracle;
+ export DERBY_HOME=/usr/lib/jvm/java-8-oracle/db;
+ export ONOS_APPS=<%= @onos_extra_features %>
+ [ -f /opt/onos/options ] && . /opt/onos/options
+ start-stop-daemon --signal INT --start --chuid $ONOS_USER \
+ --exec /opt/onos/bin/onos-service -- $ONOS_OPTS \
+ >/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log
+end script
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb
new file mode 100644
index 00000000..947d7947
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/netconfig.sh.erb
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -eux
+ping -c 5 <%= @gateway_ip %>
+gatewayMac=`arp -a <%= @gateway_ip -%> | awk '{print $4}'`
+/opt/onos/bin/onos "externalgateway-update -m $gatewayMac"
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/tablets.json.erb b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/tablets.json.erb
new file mode 100644
index 00000000..de52967d
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/templates/tablets.json.erb
@@ -0,0 +1,69 @@
+{
+ "nodes": [
+ <%- index = 1 -%>
+ <%- @manager_ip.each do |ip| -%>
+ <%- if index == @manager_ip.size -%>
+ {
+ "ip": "<%= ip %>",
+ "id": "<%= ip %>",
+ "tcpPort": 9876
+ }
+ <%- else -%>
+ {
+ "ip": "<%= ip %>",
+ "id": "<%= ip %>",
+ "tcpPort": 9876
+ },
+ <%- end -%>
+ <%- index = index + 1 -%>
+ <%- end -%>
+ ],
+ "partitions": {
+ <%- key = 1 -%>
+ <%- @manager_ip.each do |ip| -%>
+ <%- if key == @manager_ip.size -%>
+ "p<%= key -%>":[
+ <%- index = 1 -%>
+ <%- @manager_ip.each do |ip| -%>
+ <%- if index == @manager_ip.size -%>
+ {
+ "ip": "<%= ip %>",
+ "id": "<%= ip %>",
+ "tcpPort": 9876
+ }
+ <%- else -%>
+ {
+ "ip": "<%= ip %>",
+ "id": "<%= ip %>",
+ "tcpPort": 9876
+ },
+ <%- end -%>
+ <%- index = index + 1 -%>
+ <%- end -%>
+ ]
+ <%- key = key + 1 -%>
+ <%- else -%>
+ "p<%= key -%>":[
+ <%- index = 1 -%>
+ <%- @manager_ip.each do |ip| -%>
+ <%- if index == @manager_ip.size -%>
+ {
+ "ip": "<%= ip %>",
+ "id": "<%= ip %>",
+ "tcpPort": 9876
+ }
+ <%- else -%>
+ {
+ "ip": "<%= ip %>",
+ "id": "<%= ip %>",
+ "tcpPort": 9876
+ },
+ <%- end -%>
+ <%- index = index + 1 -%>
+ <%- end -%>
+ ],
+ <%- key = key + 1 -%>
+ <%- end -%>
+ <%- end -%>
+}
+}