summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-12-22 17:58:21 +0100
committerGitHub <noreply@github.com>2023-12-22 17:58:21 +0100
commit4393a2fb056574f5079270554d30751d11bf5a9a (patch)
treec0d7805976bc9a1730ac2da22231a19c21ed0048
parentdfbc854157fa4655a8f459b2447df64dc74119d1 (diff)
parentf999a7160745668dbcfd79a3c71bb8510d1aaabe (diff)
downloadvyos-1x-4393a2fb056574f5079270554d30751d11bf5a9a.tar.gz
vyos-1x-4393a2fb056574f5079270554d30751d11bf5a9a.zip
Merge pull request #2676 from sever-sever/T5840
T5840: Add override for systemd kea-ctrl-agent.service
-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)