diff options
Diffstat (limited to 'mcp/salt-formulas/opendaylight/server.sls')
-rw-r--r-- | mcp/salt-formulas/opendaylight/server.sls | 49 |
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 %} |