From 9bde0d9410722329debe8cf0ffcb292fbfc4ec96 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 10 Sep 2023 22:02:14 +0200 Subject: [PATCH] home.router: upgrade to bookworm and switch to kea-dhcp-server --- bundles/kea-dhcp-server/items.py | 16 +++++++++++++--- nodes/home/router.py | 18 +++++++----------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/bundles/kea-dhcp-server/items.py b/bundles/kea-dhcp-server/items.py index 921bf78..9171d0b 100644 --- a/bundles/kea-dhcp-server/items.py +++ b/bundles/kea-dhcp-server/items.py @@ -5,8 +5,6 @@ kea_config = { 'interfaces': sorted(node.metadata.get('kea-dhcp-server/subnets', {}).keys()), }, 'subnet4': [], - }, - 'Server': { 'loggers': [{ 'name': 'kea-dhcp4', 'output_options': [{ @@ -39,4 +37,16 @@ for iface, config in sorted(node.metadata.get('kea-dhcp-server/subnets', {}).ite ] }) -# TODO deploy config +files['/etc/kea/kea-dhcp4.conf'] = { + 'content': repo.libs.faults.dict_as_json(kea_config), + 'triggers': { + 'svc_systemd:kea-dhcp4-server:restart', + }, +} + +svc_systemd['kea-dhcp4-server'] = { + 'needs': { + 'file:/etc/kea/kea-dhcp4.conf', + 'pkg_apt:kea-dhcp4-server', + }, +} diff --git a/nodes/home/router.py b/nodes/home/router.py index b61fe14..747935b 100644 --- a/nodes/home/router.py +++ b/nodes/home/router.py @@ -2,7 +2,7 @@ nodes['home.router'] = { 'hostname': '172.19.138.1', 'bundles': { 'bird', - 'dhcpd', + 'kea-dhcp-server', 'nginx', 'pppd', 'radvd', @@ -12,7 +12,7 @@ nodes['home.router'] = { 'wireguard', }, 'groups': { - 'debian-bullseye', + 'debian-bookworm', }, 'metadata': { 'interfaces': { @@ -45,30 +45,26 @@ nodes['home.router'] = { 'restart_pppd': '23 2 * * * root systemctl restart pppoe && date -u +\%s > /var/tmp/pppd-last-restart.status', }, }, - 'dhcpd': { + 'kea-dhcp-server': { 'subnets': { 'enp1s0.1138': { - 'range_lower': '172.19.138.100', - 'range_higher': '172.19.138.250', + 'lower': '172.19.138.100', + 'higher': '172.19.138.250', 'subnet': '172.19.138.0/24', 'options': { - 'broadcast-address': '172.19.138.255', 'domain-name': 'franzi-home.kunbox.net', 'domain-name-servers': '172.19.138.1', 'domain-search': 'home.kunbox.net', 'routers': '172.19.138.1', - 'subnet-mask': '255.255.255.0', }, }, 'enp1s0.1139': { - 'range_lower': '172.19.139.200', - 'range_higher': '172.19.139.250', + 'lower': '172.19.139.200', + 'higher': '172.19.139.250', 'subnet': '172.19.139.0/24', 'options': { - 'broadcast-address': '172.19.139.255', 'domain-name-servers': '172.19.139.1', 'routers': '172.19.139.1', - 'subnet-mask': '255.255.255.0', }, }, },