[odl] Disable PaxOsgi logging by default
[fuel.git] / mcp / salt-formulas / salt-formula-opendaylight / opendaylight / config.sls
1 ##############################################################################
2 # Copyright (c) 2019 Mirantis Inc. and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {% from "opendaylight/map.jinja" import server with context %}
9
10 /opt/opendaylight/etc/jetty.xml:
11   file.managed:
12   - source: salt://opendaylight/files/jetty.xml
13   - template: jinja
14   - user: odl
15   - group: odl
16
17 /opt/opendaylight/bin/setenv:
18   file.managed:
19   - source: salt://opendaylight/files/setenv.shell
20   - template: jinja
21   - mode: 0755
22   - user: odl
23   - group: odl
24
25 {%- set features = [] %}
26 {%- for f in server.karaf_features.itervalues() %}
27   {%- do features.extend(f) %}
28 {%- endfor %}
29
30 /opt/opendaylight/etc/org.apache.karaf.features.cfg:
31   ini.options_present:
32   - sections:
33       featuresBoot: {{ features|join(',') }}
34
35 /opt/opendaylight/etc/org.ops4j.pax.web.cfg:
36   ini.options_present:
37   - sections:
38       org.ops4j.pax.web.listening.addresses: {{ server.odl_bind_ip }}
39       org.osgi.service.http.port: {{ server.odl_rest_port }}
40
41 {%- if not server.pax_logging_enabled|d(false) %}
42   {%-
43     set pax_logging_opts = [
44       'log4j2.rootLogger.appenderRef.PaxOsgi.ref',
45       'log4j2.appender.osgi.type',
46       'log4j2.appender.osgi.name',
47       'log4j2.appender.osgi.filter'
48     ]
49   %}
50
51   {%- for opt in pax_logging_opts %}
52 pax.logging.cfg.{{ opt }}:
53   file.comment:
54   - name: /opt/opendaylight/etc/org.ops4j.pax.logging.cfg
55   - regex: ^{{ opt }}\s*=
56   - backup: false
57   {%- endfor %}
58 {%- endif %}
59
60 /opt/opendaylight/etc/org.opendaylight.openflowplugin.cfg:
61   file.managed:
62   - user: odl
63   - group: odl
64   ini.options_present:
65   - sections:
66       is-statistics-polling-on: {{ server.stats_polling_enabled }}
67
68 {%- if server.get('router_enabled', false) %}
69 /opt/opendaylight/etc/custom.properties:
70   ini.options_present:
71   - sections:
72       ovsdb.l3.fwd.enabled: 'yes'
73       ovsdb.of.version: 1.3
74 {%- endif %}
75
76 {%- if server.netvirt_nat_mode is defined %}
77 /opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-natservice-config.xml:
78   file.managed:
79   - source: salt://opendaylight/files/netvirt-natservice-config.xml
80   - template: jinja
81   - makedirs: true
82   - user: odl
83   - group: odl
84 {%- endif %}
85
86 {%- if server.dhcp.enabled %}
87 /opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml:
88   file.managed:
89   - source: salt://opendaylight/files/netvirt-dhcpservice-config.xml
90   - template: jinja
91   - makedirs: true
92   - user: odl
93   - group: odl
94 {%- endif %}