From 7fa5e3c80fd05eec425b38c6c2fa5536c9719225 Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Tue, 14 Aug 2018 16:12:14 +0400 Subject: [opendaylight] Support built-in DHCP service Change-Id: I448aa7f076e2c2d641a5326947852b3333728460 Signed-off-by: Michael Polenchuk --- .../files/netvirt-dhcpservice-config.xml | 23 ++++++++++++++++++++++ .../opendaylight/map.jinja | 4 ++++ .../opendaylight/server.sls | 12 ++++++----- 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-dhcpservice-config.xml 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 index 000000000..336957fd1 --- /dev/null +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/files/netvirt-dhcpservice-config.xml @@ -0,0 +1,23 @@ +{%- from "opendaylight/map.jinja" import server with context -%} + + + {{ server.dhcp.enabled }} + {{ server.dhcp.dynamic_allocation_pool_enabled }} + diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja index 38575111e..e0b495952 100644 --- a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/map.jinja @@ -16,6 +16,10 @@ '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', diff --git a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls index 206dc52a2..ff5a0bbfa 100644 --- a/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls +++ b/mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls @@ -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 -- cgit 1.2.3-korg