[odl] Create parent directories for dhcp config 63/61963/1
authorMichael Polenchuk <mpolenchuk@mirantis.com>
Fri, 7 Sep 2018 06:54:50 +0000 (10:54 +0400)
committerMichael Polenchuk <mpolenchuk@mirantis.com>
Fri, 7 Sep 2018 06:54:50 +0000 (10:54 +0400)
Change-Id: I7d16bcd42a059817d7a4e6b06490e03001354f4f
Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
mcp/salt-formulas/salt-formula-opendaylight/opendaylight/server.sls

index ff5a0bb..35ab353 100644 (file)
@@ -53,7 +53,6 @@ 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
@@ -101,11 +100,16 @@ opendaylight:
       - service: opendaylight
 {%- endif %}
 
+{%- if server.dhcp.enabled %}
 /opt/opendaylight/etc/opendaylight/datastore/initial/config/netvirt-dhcpservice-config.xml:
   file.managed:
   - source: salt://opendaylight/files/netvirt-dhcpservice-config.xml
+  - makedirs: true
+  - watch_in:
+    - service: opendaylight
   - use:
     - file: /opt/opendaylight/etc/jetty.xml
+{%- endif %}
 
 {%- if grains['cpuarch'] == 'aarch64' %}
 opendaylight-leveldbjni: