summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/opendaylight/config.sls94
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja11
-rw-r--r--mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls159
3 files changed, 139 insertions, 125 deletions
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/config.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/config.sls
new file mode 100644
index 000000000..2d23c7563
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/config.sls
@@ -0,0 +1,94 @@
+##############################################################################
+# Copyright (c) 2019 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 %}
+
+/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
+ - template: jinja
+ - mode: 0755
+ - user: odl
+ - group: odl
+
+{%- set features = [] %}
+{%- for f in server.karaf_features.itervalues() %}
+ {%- do features.extend(f) %}
+{%- endfor %}
+
+/opt/opendaylight/etc/org.apache.karaf.features.cfg:
+ ini.options_present:
+ - sections:
+ featuresBoot: {{ features|join(',') }}
+
+/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 not server.pax_logging_enabled|d(false) %}
+ {%-
+ set pax_logging_opts = [
+ 'log4j2.rootLogger.appenderRef.PaxOsgi.ref',
+ 'log4j2.appender.osgi.type',
+ 'log4j2.appender.osgi.name',
+ 'log4j2.appender.osgi.filter'
+ ]
+ %}
+
+ {%- for opt in pax_logging_opts %}
+pax.logging.cfg.{{ opt }}:
+ file.comment:
+ - name: /opt/opendaylight/etc/org.ops4j.pax.logging.cfg
+ - regex: ^{{ opt }}\s*=
+ - backup: false
+ {%- endfor %}
+{%- endif %}
+
+/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg:
+ file.managed:
+ - user: odl
+ - group: odl
+ ini.options_present:
+ - sections:
+ is-statistics-polling-on: {{ server.stats_polling_enabled }}
+
+{%- 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
+{%- endif %}
+
+{%- if server.netvirt_nat_mode is defined %}
+/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-natservice-config.xml:
+ file.managed:
+ - source: salt://opendaylight/files/netvirt-natservice-config.xml
+ - template: jinja
+ - makedirs: true
+ - user: odl
+ - group: odl
+{%- endif %}
+
+{%- if server.dhcp.enabled %}
+/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml:
+ file.managed:
+ - source: salt://opendaylight/files/netvirt-dhcpservice-config.xml
+ - template: jinja
+ - makedirs: true
+ - user: odl
+ - group: odl
+{%- endif %}
diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja
index f8d49643b..44f2685d0 100644
--- a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja
+++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja
@@ -1,13 +1,17 @@
##############################################################################
-# Copyright (c) 2017 Mirantis Inc. and others.
+# Copyright (c) 2019 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 pkgs = ['opendaylight'] %}
+{%- do pkgs.append('opendaylight-leveldbjni') if grains['cpuarch'] == 'aarch64' %}
+
{% set server = salt['grains.filter_by']({
'Debian': {
+ 'pkgs': pkgs,
'karaf_features': {'default': ['standard', 'wrap', 'ssh']},
'odl_rest_port': '8282',
'odl_bind_ip': '0.0.0.0',
@@ -25,8 +29,5 @@
'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
index e688575c8..d150e78a4 100644
--- a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls
+++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls
@@ -1,52 +1,55 @@
##############################################################################
-# Copyright (c) 2017 Mirantis Inc. and others.
+# Copyright (c) 2019 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 %}
+include:
+ - opendaylight.config
+
# NOTE: starting with Salt 2018.3, key_text might be used instead
opendaylight_repo_key:
# Launchpad PPA for ODL Team
# pub 4096R/44C05248 2017-01-26
cmd.run:
- - name: |
- cat <<-EOF | sudo apt-key add -
- -----BEGIN PGP PUBLIC KEY BLOCK-----
- Version: GnuPG v1
-
- mQINBFiKaBEBEADpCtIj8utf/bUfN6iQ+sxGiOPLnXVYoYyKifHDazD4o1Jevfiu
- EpcDIx9EdnhrCpvKTU+jaw2B7K3pkdqbjbzjZY+2CDENSQXfRHuuI/nWDaYI0stx
- Tf/evip3cxdutnZNAklzk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3xajlSzq9ruWS4SlWq2Vzdx/acvF7Oa
+ ABA11wIjzLc9vmhzQNiRa53fJQwi+w/Or9LtH2msKCbcPVHoZ5OT4t6S8QARAQAB
+ tBpMYXVuY2hwYWQgUFBBIGZvciBPREwgVGVhbYkCOAQTAQIAIgUCWIpoEQIbAwYL
+ CQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQe4qho0TAUkgAmg//XY/RqU4WcT+p
+ 13oDc3+Dp4aL+rwaNz0o56i0z0cYPxd8GPicCuS8d/di07GnQiBcZ5DZgegnnaYm
+ OUF+phxk4q+jYO/t2GHQlYSf/QyUv7OimidLOHN1FiahmcGobliwih70o6ZcMT84
+ ggSu8jBzA/HLFBIkgStKD/staR5zJ2HfK298yVhiffyrPA+I3nPe7pvTaGa2e8AP
+ BYs5zB5n27upSZIokXFvqlmS4HEKDmPcY061wgmg1cNY1Y+mIuGjxY1Igbi6kAe0
+ yaLN2AN4c2ImhpwOcuazKTe/q2ZhoPTpYvuzmogwau8LBjRBhVS6fkTpSBPEkcwn
+ f/QYmmVLygmpMDHuHapyH8iaUoksq7gd64iBRDJQN7giQSjkTVvcGBqoKG8lbUMV
+ MDT4FGuYYsObWUg7kmHlNq9nIVlAxmxv8ZTg9+8xy3f53aId/51m+gW9LGRAT94T
+ ZIWrF9cBvsPWoHgHkV1At/fPprOvNXqeQiJ7UzC3ikDNCu2AjPEbA4sb019RNgtj
+ jUI6g6RZdzbeKVpptxILCtT3yKbfKj8AfrfaRzS0yMhVudgLolIUA4S6g46p0Cgy
+ gITO49wxxBu6UAOsAG3psDRlsZmmrT4AH09Yt2RzmY0FBWValqpoPagheQqeU+2W
+ FKnV9Lw1SKMtWZbYMvIlB0rwts3k9lE=
+ =xkZ9
+ -----END PGP PUBLIC KEY BLOCK-----
+ EOF
+ - unless: apt-key list | grep -qF '4096R/44C05248 2017-01-26'
opendaylight_repo:
pkgrepo.managed:
@@ -79,6 +82,7 @@ configure_cluster:
opendaylight:
pkg.installed:
+ - names: {{ server.pkgs }}
- require:
- pkgrepo: opendaylight_repo
service.running:
@@ -87,91 +91,6 @@ opendaylight:
- 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
- - ini: /opt/opendaylight/etc/org.opendaylight.openflowplugin.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 }}
-
-/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg_present:
- file.managed:
- - name: /opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg
- - require_in:
- - ini: /opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg
-
-/opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg:
- ini.options_present:
- - sections:
- is-statistics-polling-on: {{ server.stats_polling_enabled }}
-
-{%- 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 server.netvirt_nat_mode is defined %}
-/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-natservice-config.xml:
- file.managed:
- - source: salt://opendaylight/files/netvirt-natservice-config.xml
- - makedirs: true
- - watch_in:
- - service: opendaylight
- - use:
- - file: /opt/opendaylight/etc/jetty.xml
-{%- endif %}
-
-{%- if server.dhcp.enabled %}
-/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml:
- file.managed:
- - source: salt://opendaylight/files/netvirt-dhcpservice-config.xml
- - makedirs: true
- - watch_in:
- - service: opendaylight
- - use:
- - file: /opt/opendaylight/etc/jetty.xml
-{%- endif %}
-
-{%- if grains['cpuarch'] == 'aarch64' %}
-opendaylight-leveldbjni:
- pkg.installed
-{%- endif %}
+ - sls: opendaylight.config
{%- endif %}