f7a97417ee61e725b8118d6c08323ba3f82f3f73
[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     - ini: /opt/opendaylight/etc/org.ops4j.pax.web.cfg
18   service.running:
19   - enable: true
20   - watch:
21     - file: /opt/opendaylight/etc/jetty.xml
22     - file: /opt/opendaylight/bin/setenv
23     - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg
24     - ini: /opt/opendaylight/etc/org.ops4j.pax.web.cfg
25
26 /opt/opendaylight/etc/jetty.xml:
27   file.managed:
28   - source: salt://opendaylight/files/jetty.xml
29   - template: jinja
30   - user: odl
31   - group: odl
32
33 /opt/opendaylight/bin/setenv:
34   file.managed:
35   - source: salt://opendaylight/files/setenv.shell
36   - mode: 0755
37   - use:
38     - file: /opt/opendaylight/etc/jetty.xml
39
40 {% set features %}
41 {%- for f in server.karaf_features.itervalues() -%}
42 {{ f | join(',') }}{%- if not loop.last %},{%- endif %}
43 {%- endfor %}
44 {% endset %}
45
46 /opt/opendaylight/etc/org.apache.karaf.features.cfg:
47   ini.options_present:
48     - sections:
49         featuresBoot: {{ features }}
50
51 /opt/opendaylight/etc/org.ops4j.pax.web.cfg:
52   ini.options_present:
53     - sections:
54         org.ops4j.pax.web.listening.addresses: {{ server.odl_bind_ip }}
55
56 {%- if server.get('router_enabled', false) %}
57 /opt/opendaylight/etc/custom.properties:
58   ini.options_present:
59     - sections:
60         ovsdb.l3.fwd.enabled: 'yes'
61         ovsdb.of.version: 1.3
62     - require:
63       - pkg: opendaylight
64     - watch_in:
65       - service: opendaylight
66 {%- endif %}
67
68 {%- endif %}