8c6c3b28afa755141b0f37f3b5fe8eb69fb426ce
[fuel.git] / mcp / salt-formulas / opendaylight / server.sls
1 {% from "opendaylight/map.jinja" import server with context %}
2
3 {%- if server.enabled %}
4
5 opendaylight_repo:
6   pkgrepo.managed:
7   - ppa: {{ server.repo }}
8
9 opendaylight:
10   pkg.installed:
11   - require:
12     - pkgrepo: opendaylight_repo
13   - require_in:
14     - file: /opt/opendaylight/etc/jetty.xml
15     - file: /opt/opendaylight/bin/setenv
16     - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg
17   service.running:
18   - enable: true
19   - watch:
20     - file: /opt/opendaylight/etc/jetty.xml
21     - file: /opt/opendaylight/bin/setenv
22     - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg
23
24 /opt/opendaylight/etc/jetty.xml:
25   file.managed:
26   - source: salt://opendaylight/files/jetty.xml
27   - template: jinja
28   - user: odl
29   - group: odl
30
31 /opt/opendaylight/bin/setenv:
32   file.managed:
33   - source: salt://opendaylight/files/setenv.shell
34   - mode: 0755
35   - use:
36     - file: /opt/opendaylight/etc/jetty.xml
37
38 {% set features %}
39 {%- for f in server.karaf_features.itervalues() -%}
40 {{ f | join(',') }}{%- if not loop.last %},{%- endif %}
41 {%- endfor %}
42 {% endset %}
43
44 /opt/opendaylight/etc/org.apache.karaf.features.cfg:
45   ini.options_present:
46     - sections:
47         featuresBoot: {{ features }}
48
49 {%- if server.get('router_enabled', false) %}
50 /opt/opendaylight/etc/custom.properties:
51   ini.options_present:
52     - sections:
53         ovsdb.l3.fwd.enabled: 'yes'
54         ovsdb.of.version: 1.3
55     - require:
56       - pkg: opendaylight
57     - watch_in:
58       - service: opendaylight
59 {%- endif %}
60
61 {%- endif %}