...
 
Commits (5)
......@@ -17,12 +17,3 @@ kea_control_agent_config: "kea-control-agent.conf.j2"
kea_ha_mode: "none"
kea_control_agent_port: 8080
package_packages: {
"freebsd": ["kea"]
}
package_service: {
"freebsd": "kea"
}
{
"Control-agent": {
{%- if network.devices is defined -%}
{%- for ifname, ifdata in network.devices.items() if ifdata.services is defined and ("dhcp-ha" in (ifdata.services | default([]))) -%}
"http-host": "{{ ifdata.ipv4 | default(ifdata.ipv6 | default('127.0.0.1')) }}",
"http-port": {{ kea_control_agent_port }},
{%- endfor -%}
{%- endif -%}
"control-sockets": {
"dhcp4": {
"socket-type": "unix",
"socket-name": "/tmp/kea-dhcp4-ctrl.sock"
},
"dhcp6": {
"socket-type": "unix",
"socket-name": "/tmp/kea-dhcp6-ctrl.sock"
}
}
}
}
{% if dhcp_backend == "memfile" %}
{% macro backends(ipversion="ipv4") %}
{% if dhcp_backend == "memfile" %}
"lease-database": {
"type": "memfile",
{% if ipversion == "ipv4" %}
"name": "/var/db/kea/kea-leases4"
{% else %}
"name": "/var/db/kea/kea-leases6"
{% endif %}
},
{% elif dhcp_backend == "cassandra" %}
{% elif dhcp_backend == "cassandra" %}
"lease-database": {
"type": "cql",
"keyspace": "{{ dhcp_db_dbname }}"
"contact-points": "{{ dhcp_db_host }}"
{% if dhcp_db_port is defined %}
{% if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
{% endif %}
},
{% else %}
{% else %}
"lease-database": {
"type": "{{ dhcp_backend }}",
"name": "{{ dhcp_db_dbname }}",
"host": "{{ dhcp_db_host }}",
{% if dhcp_db_port is defined %}
{% if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
{% endif %}
"user": "{{ dhcp_db_user }}"
"password": "{{ dhcp_db_password | default("") }}"
},
......@@ -28,10 +33,11 @@
"type": "{{ dhcp_backend }}",
"name": "{{ dhcp_db_dbname }}",
"host": "{{ dhcp_db_host }}",
{% if dhcp_db_port is defined %}
{% if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
{% endif %}
"user": "{{ dhcp_db_user }}"
"password": "{{ dhcp_db_password | default("") }}"
},
{% endif %}
{% endif %}
{% endmacro %}
......@@ -12,12 +12,14 @@
"socket-name": "/tmp/kea-dhcp4-ctrl.sock"
},
{% include "kea-dhcp-backends.j2" %}
{% from "kea-dhcp-backends.j2" import backends with context %}
{{ backends("ipv4") }}
"valid-lifetime": {{ dhcp_leasetimes["default"] }},
{%- if kea_ha_mode != "none" -%}
{% include "kea-dhcp-ha.j2" %}
{% from "kea-dhcp-ha.j2" import ha with context %}
{{ ha("ipv4") }}
{%- endif -%}
{%- set ipv4subnets = [] -%}
......@@ -111,7 +113,7 @@
"output": "/var/log/kea-dhcp4.log"
}
],
"severity": "INFO",
"severity": "INFO"
}
]
}
......
......@@ -11,46 +11,16 @@
"socket-name": "/tmp/kea-dhcp6-ctrl.sock"
},
{% if dhcp_backend == "memfile" %}
"lease-database": {
"type": "memfile",
"name": "/var/db/kea/kea-leases6"
},
{% elif dhcp_backend == "cassandra" %}
"lease-database": {
"type": "cql",
"keyspace": "{{ dhcp_db_dbname }}"
"contact-points": "{{ dhcp_db_host }}"
{% if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
},
{% else %}
"lease-database": {
"type": "{{ dhcp_backend }}",
"name": "{{ dhcp_db_dbname }}",
"host": "{{ dhcp_db_host }}",
{% if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
"user": "{{ dhcp_db_user }}"
"password": "{{ dhcp_db_password | default("") }}"
},
"hosts-database": {
"type": "{{ dhcp_backend }}",
"name": "{{ dhcp_db_dbname }}",
"host": "{{ dhcp_db_host }}",
{% if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
"user": "{{ dhcp_db_user }}"
"password": "{{ dhcp_db_password | default("") }}"
},
{% endif %}
{% from "kea-dhcp-backends.j2" import backends with context %}
{{ backends("ipv6") }}
"valid-lifetime": {{ dhcp_leasetimes["default"] }},
{%- if kea_ha_mode != "none" -%}
{% from "kea-dhcp-ha.j2" import ha with context %}
{{ ha("ipv6") }}
{%- endif -%}
{%- set ipv6subnets = [] -%}
{%- for netclassname, netclass in network.classes.items() if netclass.dhcp is defined -%}
{%- if netclass.dhcp.ipv6 is defined -%}
......@@ -132,7 +102,7 @@
"output": "/var/log/kea-dhcp6.log"
}
],
"severity": "INFO",
"severity": "INFO"
}
]
}
......
---
# vars file for package.dhcp.kea/
\ No newline at end of file
package_packages: {
"freebsd": ["kea"]
}
package_service: {
"freebsd": "kea"
}