kea-dhcp-backends.j2 1.24 KB
Newer Older
1
2
{% macro backends(ipversion="ipv4") %}
{%   if dhcp_backend == "memfile" %}
3
4
    "lease-database": {
        "type": "memfile",
5
{%     if ipversion == "ipv4" %}
6
        "name": "/var/db/kea/kea-leases4"
7
8
9
{%     else %}
        "name": "/var/db/kea/kea-leases6"
{%     endif %}
10
    },
11
{%   elif dhcp_backend == "cassandra" %}
12
13
14
15
    "lease-database": {
        "type": "cql",
        "keyspace": "{{ dhcp_db_dbname }}"
        "contact-points": "{{ dhcp_db_host }}"
16
{%     if dhcp_db_port is defined %}
17
        "port": "{{ dhcp_db_port }}"
18
{%     endif %}
19
    },
20
{%   else %}
21
22
23
24
    "lease-database": {
        "type": "{{ dhcp_backend }}",
        "name": "{{ dhcp_db_dbname }}",
        "host": "{{ dhcp_db_host }}",
25
{%     if dhcp_db_port is defined %}
26
        "port": "{{ dhcp_db_port }}"
27
{%     endif %}
28
29
30
31
32
33
34
35
        "user": "{{ dhcp_db_user }}"
        "password": "{{ dhcp_db_password | default("") }}"
    },

    "hosts-database": {
        "type": "{{ dhcp_backend }}",
        "name": "{{ dhcp_db_dbname }}",
        "host": "{{ dhcp_db_host }}",
36
{%     if dhcp_db_port is defined %}
37
        "port": "{{ dhcp_db_port }}"
38
{%     endif %}
39
40
41
        "user": "{{ dhcp_db_user }}"
        "password": "{{ dhcp_db_password | default("") }}"
    },
42
43
{%   endif %}
{% endmacro %}