summaryrefslogtreecommitdiffstats
path: root/mcp/salt-formulas/opendaylight/server.sls
diff options
context:
space:
mode:
authorMichael Polenchuk <mpolenchuk@mirantis.com>2017-06-27 12:52:39 +0400
committerMichael Polenchuk <mpolenchuk@mirantis.com>2017-06-29 16:35:25 +0400
commit3fb5e5454045860463a92c18d4d859967002e6fb (patch)
tree7a68c5868e2f29dd1b57794dea4ea0921a630c24 /mcp/salt-formulas/opendaylight/server.sls
parentcaad7b5e20d66fafb391a37f2bfefc2e654dad6c (diff)
Bring in opendaylight support
Change-Id: I2eed0cf19907f257be1cb4aee96528cc41f4843a Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
Diffstat (limited to 'mcp/salt-formulas/opendaylight/server.sls')
-rw-r--r--mcp/salt-formulas/opendaylight/server.sls49
1 files changed, 49 insertions, 0 deletions
diff --git a/mcp/salt-formulas/opendaylight/server.sls b/mcp/salt-formulas/opendaylight/server.sls
new file mode 100644
index 000000000..cb5b3120c
--- /dev/null
+++ b/mcp/salt-formulas/opendaylight/server.sls
@@ -0,0 +1,49 @@
+{% from "opendaylight/map.jinja" import server with context %}
+
+{%- if server.enabled %}
+
+opendaylight_repo:
+ pkgrepo.managed:
+ - ppa: {{ server.repo }}
+
+opendaylight:
+ pkg.installed:
+ - require:
+ - pkgrepo: opendaylight_repo
+ - require_in:
+ - file: /opt/opendaylight/etc/jetty.xml
+ - file: /opt/opendaylight/bin/setenv
+ - file: /opt/opendaylight/etc/org.apache.karaf.features.cfg
+ service.running:
+ - enable: true
+ - watch:
+ - file: /opt/opendaylight/etc/jetty.xml
+ - file: /opt/opendaylight/bin/setenv
+ - file: /opt/opendaylight/etc/org.apache.karaf.features.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:
+ file.replace:
+ - pattern: ^featuresBoot=.*$
+ - repl: "featuresBoot={{ features }}"
+
+{%- endif %}