aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/salt-formulas/salt-formula-opendaylight
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/salt-formulas/salt-formula-opendaylight')
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/single.yml20
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/metadata/service/support.yml19
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/jetty.xml132
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/setenv.shell21
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/opendaylight/init.sls12
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja28
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls113
7 files changed, 345 insertions, 0 deletions
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/single.yml b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/single.yml
new file mode 100644
index 000000000..3a762b39a
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/server/single.yml
@@ -0,0 +1,20 @@
+##############################################################################
+# Copyright (c) 2017 Mirantis Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+applications:
+ - opendaylight
+parameters:
+ _param:
+ version: oxygen
+ opendaylight:
+ server:
+ enabled: 'True'
+ version: ${_param:version}
+ repo: 'odl-team/${_param:version}'
+ logging:
+ engine: syslog
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/support.yml b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/support.yml
new file mode 100644
index 000000000..bbb204315
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-opendaylight/metadata/service/support.yml
@@ -0,0 +1,19 @@
+##############################################################################
+# Copyright (c) 2017 Mirantis Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+parameters:
+ opendaylight:
+ _support:
+ collectd:
+ enabled: false
+ heka:
+ enabled: false
+ sensu:
+ enabled: false
+ sphinx:
+ enabled: false
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/jetty.xml b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/jetty.xml
new file mode 100644
index 000000000..de2ac677d
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/jetty.xml
@@ -0,0 +1,132 @@
+{%- from "opendaylight/map.jinja" import server with context -%}
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//
+DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
+
+<Configure id="Server" class="org.eclipse.jetty.server.Server">
+
+ <!-- =========================================================== -->
+ <!-- Set connectors -->
+ <!-- =========================================================== -->
+ <!-- One of each type! -->
+ <!-- =========================================================== -->
+
+ <!-- Use this connector for many frequently idle connections and for
+ threadless continuations. -->
+ <New id="http-default" class="org.eclipse.jetty.server.HttpConfiguration">
+ <Set name="secureScheme">https</Set>
+ <Set name="securePort">
+ <Property name="jetty.secure.port" default="8543" />
+ </Set>
+ <Set name="outputBufferSize">32768</Set>
+ <Set name="requestHeaderSize">8192</Set>
+ <Set name="responseHeaderSize">8192</Set>
+
+ <!-- Default security setting: do not leak our version -->
+ <Set name="sendServerVersion">false</Set>
+
+ <Set name="sendDateHeader">false</Set>
+ <Set name="headerCacheSize">512</Set>
+ </New>
+
+ <New id="http-legacy" class="org.eclipse.jetty.server.HttpConfiguration">
+ <Set name="secureScheme">https</Set>
+ <Set name="securePort">
+ <Property name="jetty.secure.port" default="8443" />
+ </Set>
+ <Set name="outputBufferSize">32768</Set>
+ <Set name="requestHeaderSize">8192</Set>
+ <Set name="responseHeaderSize">8192</Set>
+
+ <!-- Default security setting: do not leak our version -->
+ <Set name="sendServerVersion">false</Set>
+
+ <Set name="sendDateHeader">false</Set>
+ <Set name="headerCacheSize">512</Set>
+ </New>
+
+ <Call name="addConnector">
+ <Arg>
+ <New class="org.eclipse.jetty.server.ServerConnector">
+ <Arg name="server">
+ <Ref refid="Server" />
+ </Arg>
+ <Arg name="factories">
+ <Array type="org.eclipse.jetty.server.ConnectionFactory">
+ <Item>
+ <New class="org.eclipse.jetty.server.HttpConnectionFactory">
+ <Arg name="config">
+ <Ref refid="http-default"/>
+ </Arg>
+ </New>
+ </Item>
+ </Array>
+ </Arg>
+ <Set name="host">{{ server.odl_bind_ip }}
+ <Property name="jetty.host"/>
+ </Set>
+ <Set name="port">
+ <Property name="jetty.port" default="{{ server.odl_rest_port }}"/>
+ </Set>
+ <Set name="idleTimeout">
+ <Property name="http.timeout" default="300000"/>
+ </Set>
+ <Set name="name">jetty-default</Set>
+ </New>
+ </Arg>
+ </Call>
+
+ <!-- =========================================================== -->
+ <!-- Configure Authentication Realms -->
+ <!-- Realms may be configured for the entire server here, or -->
+ <!-- they can be configured for a specific web app in a context -->
+ <!-- configuration (see $(jetty.home)/contexts/test.xml for an -->
+ <!-- example). -->
+ <!-- =========================================================== -->
+ <Call name="addBean">
+ <Arg>
+ <New class="org.eclipse.jetty.jaas.JAASLoginService">
+ <Set name="name">karaf</Set>
+ <Set name="loginModuleName">karaf</Set>
+ <Set name="roleClassNames">
+ <Array type="java.lang.String">
+ <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
+ </Item>
+ </Array>
+ </Set>
+ </New>
+ </Arg>
+ </Call>
+ <Call name="addBean">
+ <Arg>
+ <New class="org.eclipse.jetty.jaas.JAASLoginService">
+ <Set name="name">default</Set>
+ <Set name="loginModuleName">karaf</Set>
+ <Set name="roleClassNames">
+ <Array type="java.lang.String">
+ <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
+ </Item>
+ </Array>
+ </Set>
+ </New>
+ </Arg>
+ </Call>
+</Configure>
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/setenv.shell b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/setenv.shell
new file mode 100644
index 000000000..2921ade14
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/setenv.shell
@@ -0,0 +1,21 @@
+##############################################################################
+# Copyright (c) 2017 Mirantis Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{%- from "opendaylight/map.jinja" import server with context -%}
+# export JAVA_HOME # Location of Java installation
+export JAVA_MIN_MEM={{ server.java_min_mem }} # Minimum memory for the JVM
+export JAVA_MAX_MEM={{ server.java_max_mem }} # Maximum memory for the JVM
+# export JAVA_PERM_MEM # Minimum perm memory for the JVM
+export JAVA_MAX_PERM_MEM=512m # Maximum perm memory for the JVM
+export EXTRA_JAVA_OPTS='{{ server.java_extra_opts }}' # Additional JVM options
+# export KARAF_HOME # Karaf home folder
+# export KARAF_DATA # Karaf data folder
+# export KARAF_BASE # Karaf base folder
+# export KARAF_ETC # Karaf etc folder
+# export KARAF_OPTS # Additional available Karaf options
+# export KARAF_DEBUG # Enable debug mode
+# export KARAF_REDIRECT # Enable/set the std/err redirection when using bin/start
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/init.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/init.sls
new file mode 100644
index 000000000..132f69b33
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/init.sls
@@ -0,0 +1,12 @@
+##############################################################################
+# Copyright (c) 2017 Mirantis Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+include:
+{% if pillar.opendaylight.server is defined %}
+- opendaylight.server
+{% endif %}
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja
new file mode 100644
index 000000000..38575111e
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja
@@ -0,0 +1,28 @@
+##############################################################################
+# Copyright (c) 2017 Mirantis Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+{% set server = salt['grains.filter_by']({
+ 'Debian': {
+ 'karaf_features': {'default': ['standard', 'wrap', 'ssh']},
+ 'odl_rest_port': '8282',
+ 'odl_bind_ip': '0.0.0.0',
+ 'repo': 'odl-team/oxygen',
+ 'log_levels': {},
+ 'enable_ha': false,
+ 'ha_node_ips': [],
+ 'ha_node_index': 0,
+ 'security_group_mode': 'stateful',
+ 'vpp_routing_node': '',
+ 'java_extra_opts': '-Djava.net.preferIPv4Stack=true -XX:+UseG1GC',
+ 'java_min_mem': '1g',
+ 'java_max_mem': '2g',
+ },
+ 'RedHat': {
+ 'repo': 'opendaylight-6-testing'
+ },
+}, merge=salt['pillar.get']('opendaylight:server')) %}
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls
new file mode 100644
index 000000000..206dc52a2
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls
@@ -0,0 +1,113 @@
+##############################################################################
+# Copyright (c) 2017 Mirantis Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{% from "opendaylight/map.jinja" import server with context %}
+{% from "linux/map.jinja" import system with context %}
+
+{%- if server.enabled %}
+
+opendaylight_repo_key:
+ cmd.run:
+ - name: "apt-key adv --keyserver keyserver.ubuntu.com --recv 44C05248"
+{%- if system.proxy is defined and system.proxy.pkg is defined %}
+ - env:
+{%- if system.proxy.pkg.http is defined %}
+ - http_proxy: {{ system.proxy.pkg.http }}
+{%- endif %}
+{%- if system.proxy.pkg.https is defined %}
+ - https_proxy: {{ system.proxy.pkg.https }}
+{%- endif %}
+{%- endif %}
+
+opendaylight_repo:
+ pkgrepo.managed:
+ # NOTE(armband): PPA handling behind proxy broken, define it explicitly
+ # https://github.com/saltstack/salt/pull/45224
+ # - ppa: {{ server.repo }}
+ - human_name: opendaylight-ppa
+ - name: deb http://ppa.launchpad.net/odl-team/{{ server.version }}/ubuntu xenial main
+ - file: /etc/apt/sources.list.d/odl-team-ubuntu-{{ server.version }}-xenial.list
+
+{%- if grains['saltversioninfo'] < [2017, 7] %}
+service.mask:
+ module.run:
+ - m_name: opendaylight
+{%- else %}
+opendaylight_service_mask:
+ service.masked:
+ - name: opendaylight
+{%- endif %}
+
+opendaylight:
+ pkg.installed:
+ - require:
+ - pkgrepo: opendaylight_repo
+ - require_in:
+ - file: /opt/opendaylight/etc/jetty.xml
+ - file: /opt/opendaylight/bin/setenv
+ - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg
+ - ini: /opt/opendaylight/etc/org.ops4j.pax.web.cfg
+ service.running:
+ - enable: true
+{%- if grains['saltversioninfo'] >= [2017, 7] %}
+ - unmask: true
+{%- endif %}
+ - watch:
+ - file: /opt/opendaylight/etc/jetty.xml
+ - file: /opt/opendaylight/bin/setenv
+ - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg
+ - ini: /opt/opendaylight/etc/org.ops4j.pax.web.cfg
+
+/opt/opendaylight/etc/jetty.xml:
+ file.managed:
+ - source: salt://opendaylight/files/jetty.xml
+ - template: jinja
+ - user: odl
+ - group: odl
+
+/opt/opendaylight/bin/setenv:
+ file.managed:
+ - source: salt://opendaylight/files/setenv.shell
+ - mode: 0755
+ - use:
+ - file: /opt/opendaylight/etc/jetty.xml
+
+{% set features %}
+{%- for f in server.karaf_features.itervalues() -%}
+{{ f | join(',') }}{%- if not loop.last %},{%- endif %}
+{%- endfor %}
+{% endset %}
+
+/opt/opendaylight/etc/org.apache.karaf.features.cfg:
+ ini.options_present:
+ - sections:
+ featuresBoot: {{ features }}
+
+/opt/opendaylight/etc/org.ops4j.pax.web.cfg:
+ ini.options_present:
+ - sections:
+ org.ops4j.pax.web.listening.addresses: {{ server.odl_bind_ip }}
+ org.osgi.service.http.port: {{ server.odl_rest_port }}
+
+{%- if server.get('router_enabled', false) %}
+/opt/opendaylight/etc/custom.properties:
+ ini.options_present:
+ - sections:
+ ovsdb.l3.fwd.enabled: 'yes'
+ ovsdb.of.version: 1.3
+ - require:
+ - pkg: opendaylight
+ - watch_in:
+ - service: opendaylight
+{%- endif %}
+
+{%- if grains['cpuarch'] == 'aarch64' %}
+opendaylight-leveldbjni:
+ pkg.installed
+{%- endif %}
+
+{%- endif %}