[opendaylight] Support built-in DHCP service 33/60933/2
authorMichael Polenchuk <mpolenchuk@mirantis.com>
Tue, 14 Aug 2018 12:12:14 +0000 (16:12 +0400)
committerMichael Polenchuk <mpolenchuk@mirantis.com>
Wed, 5 Sep 2018 06:02:13 +0000 (10:02 +0400)
Change-Id: I448aa7f076e2c2d641a5326947852b3333728460
Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-dhcpservice-config.xml [new file with mode: 0644]
mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja
mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls

diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-dhcpservice-config.xml b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-dhcpservice-config.xml
new file mode 100644 (file)
index 0000000..336957f
--- /dev/null
@@ -0,0 +1,23 @@
+{%- from "opendaylight/map.jinja" import server with context -%}
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<dhcpservice-config xmlns="urn:opendaylight:params:xml:ns:yang:dhcpservice:config">
+  <controller-dhcp-enabled>{{ server.dhcp.enabled }}</controller-dhcp-enabled>
+  <dhcp-dynamic-allocation-pool-enabled>{{ server.dhcp.dynamic_allocation_pool_enabled }}</dhcp-dynamic-allocation-pool-enabled>
+</dhcpservice-config>
index 3857511..e0b4959 100644 (file)
       'enable_ha': false,
       'ha_node_ips': [],
       'ha_node_index': 0,
+      'dhcp': {
+        'enabled': false,
+        'dynamic_allocation_pool_enabled': false,
+      },
       'security_group_mode': 'stateful',
       'vpp_routing_node': '',
       'java_extra_opts': '-Djava.net.preferIPv4Stack=true -XX:+UseG1GC',
index 206dc52..ff5a0bb 100644 (file)
@@ -46,11 +46,6 @@ opendaylight:
   pkg.installed:
   - require:
     - pkgrepo: opendaylight_repo
-  - require_in:
-    - file: /opt/opendaylight/etc/jetty.xml
-    - file: /opt/opendaylight/bin/setenv
-    - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg
-    - ini: /opt/opendaylight/etc/org.ops4j.pax.web.cfg
   service.running:
   - enable: true
 {%- if grains['saltversioninfo'] >= [2017, 7] %}
@@ -58,6 +53,7 @@ opendaylight:
 {%- endif %}
   - watch:
     - file: /opt/opendaylight/etc/jetty.xml
+    - file: /opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml
     - file: /opt/opendaylight/bin/setenv
     - ini: /opt/opendaylight/etc/org.apache.karaf.features.cfg
     - ini: /opt/opendaylight/etc/org.ops4j.pax.web.cfg
@@ -105,6 +101,12 @@ opendaylight:
       - service: opendaylight
 {%- endif %}
 
+/opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml:
+  file.managed:
+  - source: salt://opendaylight/files/netvirt-dhcpservice-config.xml
+  - use:
+    - file: /opt/opendaylight/etc/jetty.xml
+
 {%- if grains['cpuarch'] == 'aarch64' %}
 opendaylight-leveldbjni:
   pkg.installed