aboutsummaryrefslogtreecommitdiffstats
path: root/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules
diff options
context:
space:
mode:
Diffstat (limited to 'framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules')
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/networking-onos.tarbin0 -> 860160 bytes
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/onos_config.sh34
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/onos_driver.sh10
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/config.pp55
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/ha/haproxy.pp64
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/init.pp19
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/install.pp56
-rw-r--r--framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/service.pp48
-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
13 files changed, 464 insertions, 0 deletions
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/networking-onos.tar b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/networking-onos.tar
new file mode 100644
index 00000000..961928a5
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/networking-onos.tar
Binary files differ
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/onos_config.sh b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/onos_config.sh
new file mode 100644
index 00000000..158627fd
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/onos_config.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+set -eux
+echo 'export ONOS_OPTS=debug' > /opt/onos/options;
+echo 'export ONOS_USER=root' >> /opt/onos/options;
+mkdir /opt/onos/var;
+mkdir /opt/onos/config;
+
+#jdk config
+
+mkdir /usr/lib/jvm/
+tar -xzf /opt/jdk-8u*-linux-x64.tar.gz -C /usr/lib/jvm/
+mv /usr/lib/jvm/jdk1.8.0_* /usr/lib/jvm/java-8-oracle
+
+touch /etc/profile.d/jdk.csh
+cat <<EOT>> /etc/profile.d/jdk.csh
+setenv J2SDKDIR /usr/lib/jvm/java-8-oracle
+setenv J2REDIR /usr/lib/jvm/java-8-oracle/jre
+setenv 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
+setenv JAVA_HOME /usr/lib/jvm/java-8-oracle
+setenv DERBY_HOME /usr/lib/jvm/java-8-oracle/db
+EOT
+
+touch /etc/profile.d/jdk.sh
+cat <<EOT>> /etc/profile.d/jdk.sh
+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
+EOT
+
+chmod +x /etc/profile.d/jdk*
+
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/onos_driver.sh b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/onos_driver.sh
new file mode 100644
index 00000000..d3a16514
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/files/onos_driver.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -eux
+
+cd /opt
+#git clone https://github.com/openstack/networking-onos.git
+tar xf networking-onos.tar
+cd networking-onos
+python setup.py install
+
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/config.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/config.pp
new file mode 100644
index 00000000..457d732f
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/config.pp
@@ -0,0 +1,55 @@
+class onos::config{
+$onos_home = $onos::onos_home
+$karaf_dist = $onos::karaf_dist
+$onos_boot_features = $onos::onos_boot_features
+$onos_extra_features = $onos::onos_extra_features
+$roles = $onos::roles
+$public_vip = hiera('public_vip')
+$management_vip = hiera('management_vip')
+$manager_ip = $onos::manager_ip
+$onos_names = $onos::onos_names
+
+$onos_pkg_name = $onos::onos_pkg_name
+$jdk8_pkg_name = $onos::jdk8_pkg_name
+
+Exec{
+ path => "/usr/bin:/usr/sbin:/bin:/sbin",
+ timeout => 180,
+ logoutput => "true",
+}
+
+file{ '/opt/onos_config.sh':
+ source => "puppet:///modules/onos/onos_config.sh",
+} ->
+exec{ 'install onos config':
+ command => "sh /opt/onos_config.sh;
+ rm -rf /opt/onos_config.sh;",
+}->
+exec{ "clean used files":
+ command => "rm -rf /opt/$onos_pkg_name;
+ rm -rf /opt/$jdk8_pkg_name
+ rm -rf /root/.m2/*.tar"
+}->
+exec{ 'onos boot features':
+ command => "sed -i '/^featuresBoot=/c\featuresBoot=$onos_boot_features' $onos_home/$karaf_dist/etc/org.apache.karaf.features.cfg",
+ path => "/usr/bin:/usr/sbin:/bin:/sbin",
+}
+case $::operatingsystem {
+ ubuntu:{
+ file{'/etc/init/onos.conf':
+ ensure => file,
+ content => template('onos/debian/onos.conf.erb')
+}}
+ centos:{
+ file{'/etc/init.d/onos':
+ ensure => file,
+ content => template('onos/centos/onos.erb'),
+ mode => 0777
+}}}
+
+
+#if !member($roles, 'compute') {
+# include onos::ha::haproxy
+#}
+
+}
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/ha/haproxy.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/ha/haproxy.pp
new file mode 100644
index 00000000..c35752d9
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/ha/haproxy.pp
@@ -0,0 +1,64 @@
+#
+# Copyright 2015 Mirantis, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+class onos::ha::haproxy {
+
+
+ Haproxy::Service { use_include => true }
+ Haproxy::Balancermember { use_include => true }
+
+ $public_vip = hiera('public_vip')
+ $management_vip = hiera('management_vip')
+ $nodes_hash = hiera('nodes')
+ $primary_controller_nodes = filter_nodes($nodes_hash,'role','primary-controller')
+ $onos_controllers = filter_nodes($nodes_hash,'role','onos')
+
+ # defaults for any haproxy_service within this class
+ Openstack::Ha::Haproxy_service {
+ internal_virtual_ip => $management_vip,
+ ipaddresses => filter_hash($onos_controllers, 'internal_address'),
+ public_virtual_ip => $public_vip,
+ server_names => filter_hash($onos_controllers, 'name'),
+ public => true,
+ internal => true,
+ }
+
+ openstack::ha::haproxy_service { 'onos':
+ order => '221',
+ listen_port => '8181',
+ haproxy_config_options => {
+ 'option' => ['httpchk /onos/ui', 'httplog'],
+ 'timeout client' => '2h',
+ 'timeout server' => '2h',
+ 'balance' => 'source',
+ 'mode' => 'http'
+ },
+ balancermember_options => 'check inter 2000 fall 5',
+ }
+
+ exec { 'haproxy reload onos':
+ command => 'export OCF_ROOT="/usr/lib/ocf"; (ip netns list | grep haproxy) && ip netns exec haproxy /usr/lib/ocf/resource.d/fuel/ns_haproxy reload',
+ path => '/usr/bin:/usr/sbin:/bin:/sbin',
+ logoutput => true,
+ provider => 'shell',
+ tries => 10,
+ try_sleep => 10,
+ returns => [0, ''],
+ }
+
+ Haproxy::Listen <||> -> Exec['haproxy reload onos']
+ Haproxy::Balancermember <||> -> Exec['haproxy reload onos']
+}
+
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/init.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/init.pp
new file mode 100644
index 00000000..839ae095
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/init.pp
@@ -0,0 +1,19 @@
+class onos{
+$nodes = hiera('nodes')
+$primary_controller = filter_nodes($nodes,'role','primary-controller')
+$roles = node_roles($nodes, hiera('uid'))
+
+$onos_settings = hiera('onos')
+$public_eth = $onos_settings['public_eth']
+$onos_hash = filter_nodes($nodes,'role','onos')
+$manager_ip = filter_hash($onos_hash, 'internal_address')
+$onos_names = filter_hash($onos_hash, 'name')
+
+$onos_home = '/opt/onos'
+$onos_pkg_url = 'http://downloads.onosproject.org/release/onos-1.3.0.tar.gz'
+$karaf_dist = 'apache-karaf-3.0.3'
+$onos_pkg_name = 'onos-1.3.0.tar.gz'
+$jdk8_pkg_name = 'jdk-8u51-linux-x64.tar.gz'
+$onos_boot_features = 'config,standard,region,package,kar,ssh,management,webconsole,onos-api,onos-core,onos-incubator,onos-cli,onos-rest,onos-gui,onos-openflow-base,onos-openflow'
+$onos_extra_features = 'ovsdb,vtn'
+}
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/install.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/install.pp
new file mode 100644
index 00000000..7ccb7699
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/install.pp
@@ -0,0 +1,56 @@
+
+class onos::install{
+$onos_home = $onos::onos_home
+$onos_pkg_url = $onos::onos_pkg_url
+$karaf_dist = $onos::karaf_dist
+$onos_pkg_name = $onos::onos_pkg_name
+$jdk8_pkg_name = $onos::jdk8_pkg_name
+
+
+Exec{
+ path => "/usr/bin:/usr/sbin:/bin:/sbin",
+ logoutput => "true",
+ timeout => 180,
+}
+group { 'onos':
+ ensure => present,
+ before => [File['/opt/onos/'], User['onos']],
+ }
+
+
+user { 'onos':
+ ensure => present,
+ home => '/opt/onos/',
+ membership => 'minimum',
+ groups => 'onos',
+ before => File['/opt/onos/'],
+ }
+
+
+file { '/opt/onos/':
+ ensure => 'directory',
+ recurse => true,
+ owner => 'onos',
+ group => 'onos',
+}->
+
+
+file{ "/opt/$onos_pkg_name":
+ source => "puppet:///modules/onos/$onos_pkg_name",
+} ->
+file{ "/opt/$jdk8_pkg_name":
+ source => "puppet:///modules/onos/$jdk8_pkg_name",
+} ->
+
+file{ '/root/.m2/':
+ ensure => 'directory',
+ recurse => true,
+} ->
+file{ '/root/.m2/repository.tar':
+ source => "puppet:///modules/onos/repository.tar",
+} ->
+exec{ "unzip packages":
+ command => "tar -zvxf /opt/$onos_pkg_name -C $onos_home --strip-components 1 --no-overwrite-dir -k;
+ tar xf /root/.m2/repository.tar -C /root/.m2/",
+}
+}
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/service.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/service.pp
new file mode 100644
index 00000000..45399232
--- /dev/null
+++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/modules/onos/manifests/service.pp
@@ -0,0 +1,48 @@
+
+class onos::service{
+
+$public_eth = $onos::public_eth
+Exec{
+ path => "/usr/bin:/usr/sbin:/bin:/sbin",
+ timeout => 320,
+ logoutput => 'true',
+}
+
+firewall {'221 onos':
+ port => [6633, 6640, 6653, 8181, 8101,9876],
+ proto => 'tcp',
+ action => 'accept',
+}->
+service{ 'onos':
+ ensure => running,
+ enable => true,
+ hasstatus => true,
+ hasrestart => true,
+}->
+
+exec{ 'sleep 100 to stablize onos':
+ command => 'sleep 100;'
+}->
+
+exec{ 'restart onos':
+ command => 'service onos restart',
+}->
+
+exec{ 'sleep 100 again to stablize onos':
+ command => 'sleep 100;'
+}->
+exec{ 'restart onos again':
+ command => 'service onos restart',
+}->
+
+exec{ 'sleep 60 to stablize onos':
+ command => 'sleep 60;'
+}->
+
+exec{ 'add onos auto start':
+ command => 'echo "onos">>/opt/service',
+}->
+exec{ 'set public port':
+ command => "/opt/onos/bin/onos \"externalportname-set -n $public_eth\""
+}
+}
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 -%>
+}
+}