summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/dhcp-server/10-override.conf.j22
-rwxr-xr-xsrc/conf_mode/dhcp_server.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/data/templates/dhcp-server/10-override.conf.j2 b/data/templates/dhcp-server/10-override.conf.j2
new file mode 100644
index 000000000..6cf9e0a11
--- /dev/null
+++ b/data/templates/dhcp-server/10-override.conf.j2
@@ -0,0 +1,2 @@
+[Unit]
+ConditionFileNotEmpty=
diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py
index 958e90014..e06a3c8a8 100755
--- a/src/conf_mode/dhcp_server.py
+++ b/src/conf_mode/dhcp_server.py
@@ -41,6 +41,7 @@ ctrl_config_file = '/run/kea/kea-ctrl-agent.conf'
ctrl_socket = '/run/kea/dhcp4-ctrl-socket'
config_file = '/run/kea/kea-dhcp4.conf'
lease_file = '/config/dhcp4.leases'
+systemd_override = r'/run/systemd/system/kea-ctrl-agent.service.d/10-override.conf'
ca_cert_file = '/run/kea/kea-failover-ca.pem'
cert_file = '/run/kea/kea-failover.pem'
@@ -332,6 +333,8 @@ def generate(dhcp):
dhcp['failover']['ca_cert_file'] = ca_cert_file
+ render(systemd_override, 'dhcp-server/10-override.conf.j2', dhcp)
+
render(ctrl_config_file, 'dhcp-server/kea-ctrl-agent.conf.j2', dhcp)
render(config_file, 'dhcp-server/kea-dhcp4.conf.j2', dhcp)