add tasks and resources for deploying kea dhcp server

This commit is contained in:
June 2025-04-17 20:30:59 +02:00
parent 6e59cf386a
commit 51603ad551
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
2 changed files with 158 additions and 0 deletions
deploy.yaml
resources/dhcp/files

View file

@ -3,3 +3,21 @@
hosts: all
roles:
- base_config
- name: Deploy DHCP server
hosts: dhcp
tasks:
- name: deploy kea dhcp server config
ansible.builtin.copy:
src: resources/dhcp/files/kea-dhcp4.conf
dest: /etc/kea/kea-dhcp4.conf
owner: root
group: root
mode: "0644"
notify: Restart Kea DHCP 4 server
handlers:
- name: Restart Kea DHCP 4 server
ansible.builtin.service:
name: kea-dhcp4-server
state: restarted

View file

@ -0,0 +1,140 @@
{
"Dhcp4": {
"interfaces-config": {
"interfaces": [ "eth0" ]
},
"control-socket": {
"socket-type": "unix",
"socket-name": "/run/kea/kea4-ctrl-socket"
},
"lease-database": {
"type": "memfile",
"lfc-interval": 3600,
"persist": true
},
"expired-leases-processing": {
"reclaim-timer-wait-time": 10,
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"unwarned-reclaim-cycles": 5
},
"calculate-tee-times": true,
"valid-lifetime": 7200,
"option-data": [
{
"name": "domain-name-servers",
"code": 6,
"csv-format": true,
"data": "94.45.254.2"
}
],
"subnet4": [
{
// Management
"id": 255,
"option-data": [
{
"data": "94.45.255.1",
"name": "routers"
}
],
"pools": [
{
"pool": "94.45.255.200 - 94.45.255.254"
}
],
"subnet": "94.45.255.0/24",
},
{
// Public Wired
"id": 240,
"option-data": [
{
"data": "94.45.240.1",
"name": "routers"
}
],
"pools": [
{
"pool": "94.45.240.20 - 94.45.247.254"
}
],
"subnet": "94.45.240.0/21"
},
{
// Public WLAN
"id": 224,
"option-data": [
{
"data": "94.45.224.1",
"name": "routers"
}
],
"pools": [
{
"pool": "94.45.224.20 - 94.45.239.254"
}
],
"subnet": "94.45.224.0/20"
},
{
// Public Services reachable event ONLY
"id": 540,
"option-data": [
{
"data": "94.45.254.1",
"name": "routers"
}
],
"pools": [
{
"pool": "94.45.254.100 - 94.45.254.120"
}
],
"subnet": "94.45.254.0/25"
},
{
// Public Services reachable EVERYWHERE
"id": 541,
"option-data": [
{
"data": "94.45.254.128",
"name": "routers"
}
],
"pools": [
{
"pool": "94.45.254.220 - 94.45.254.250"
}
],
"subnet": "94.45.254.128/25"
},
],
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [
{
"output": "stdout",
"pattern": "%-5p %m\n",
}
],
"severity": "INFO",
"debuglevel": 0
}
]
}
}