2017-12-28 22:10:09 +01:00
|
|
|
#
|
|
|
|
# {{ ansible_managed }}
|
|
|
|
#
|
|
|
|
{
|
|
|
|
|
|
|
|
"Dhcp4":
|
|
|
|
{
|
|
|
|
"interfaces-config": {
|
|
|
|
"interfaces": [
|
|
|
|
{% for mesh in meshes %}
|
|
|
|
{% if not loop.last %}
|
|
|
|
"{{ mesh.id }}br",
|
|
|
|
{% else %}
|
|
|
|
"{{ mesh.id }}br"
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
]
|
|
|
|
},
|
2019-01-23 15:21:10 +01:00
|
|
|
"control-socket": {
|
|
|
|
"socket-type": "unix",
|
|
|
|
"socket-name": "/tmp/kea-dhcp4-ctrl.sock"
|
|
|
|
},
|
2017-12-28 22:10:09 +01:00
|
|
|
"lease-database": {
|
|
|
|
"type": "memfile",
|
|
|
|
"persist": true,
|
|
|
|
"lfc-interval": {{ kea_lease_database['lfc_interval'] }}
|
|
|
|
},
|
|
|
|
"expired-leases-processing": {
|
|
|
|
"reclaim-timer-wait-time": {{ kea_expired_leases_processing['reclaim_timer_wait_time'] }},
|
|
|
|
"flush-reclaimed-timer-wait-time": {{ kea_expired_leases_processing['flush_reclaimed_timer_wait_time'] }} ,
|
|
|
|
"hold-reclaimed-time": {{ kea_expired_leases_processing['hold_reclaimed_time'] }},
|
|
|
|
"max-reclaim-leases": {{ kea_expired_leases_processing['max_reclaim_leases'] }},
|
|
|
|
"max-reclaim-time": {{ kea_expired_leases_processing['max_reclaim_time'] }},
|
|
|
|
"unwarned-reclaim-cycles": {{ kea_expired_leases_processing['unwarned_reclaim_cycles'] }}
|
|
|
|
},
|
|
|
|
"valid-lifetime": {{ kea_lease_time }},
|
2019-08-22 21:26:11 +02:00
|
|
|
"option-def": [
|
|
|
|
{
|
|
|
|
"name": "unifi-address",
|
|
|
|
"code": 1,
|
|
|
|
"type": "ipv4-address",
|
|
|
|
"space": "ubnt"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
{% if unifi_server is defined %}
|
|
|
|
"client-classes": [
|
|
|
|
{
|
|
|
|
"name": "ubnt",
|
|
|
|
"test": "substring(option[vendor-class-identifier].text, 0, 4) == 'ubnt'",
|
|
|
|
"option-def": [
|
|
|
|
{
|
|
|
|
"name": "vendor-encapsulated-options",
|
|
|
|
"code": 43,
|
|
|
|
"type": "empty",
|
|
|
|
"encapsulate": "ubnt"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"option-data": [
|
|
|
|
{
|
|
|
|
"name": "vendor-class-identifier",
|
|
|
|
"data": "ubnt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "unifi-address",
|
|
|
|
"space": "ubnt",
|
|
|
|
"data": "{{ loopback_net_ipv4 | ipaddr(hostvars[unifi_server + '.' + http_domain_external ]['magic']) | ipaddr('address') }}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "vendor-encapsulated-options"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
{% endif %}
|
2017-12-28 22:10:09 +01:00
|
|
|
"subnet4": [
|
|
|
|
{% for mesh in meshes %}
|
|
|
|
{
|
|
|
|
"subnet": "{{ mesh.ipv4_network | ipaddr('network/prefix') }}",
|
2019-03-02 18:10:48 +01:00
|
|
|
"pools": [ { "pool": "{{ mesh_gw_prefixes[mesh.id].ipv4_dhcp | ipaddr('net') | ipaddr('range_usable') }}" } ],
|
2017-12-28 22:10:09 +01:00
|
|
|
"option-data": [
|
|
|
|
{
|
|
|
|
"name": "routers",
|
|
|
|
"data": "{{ mesh.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') }}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "time-servers",
|
|
|
|
"data": "{{ mesh.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') }}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "domain-name-servers",
|
|
|
|
"data": "{{ mesh.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') }}"
|
2019-03-02 18:10:48 +01:00
|
|
|
}{% if mesh.dnssl is defined %},
|
2017-12-28 22:10:09 +01:00
|
|
|
{
|
|
|
|
"name": "domain-search",
|
2018-09-20 17:06:03 +02:00
|
|
|
"data": "{% for dnssl in mesh.dnssl %}{{ dnssl }}{% if not loop.last %}, {% endif %}{% endfor %}"
|
2017-12-28 22:10:09 +01:00
|
|
|
}
|
2019-03-02 18:10:48 +01:00
|
|
|
{% endif %}
|
2017-12-28 22:10:09 +01:00
|
|
|
]
|
|
|
|
{% if not loop.last %}
|
|
|
|
},
|
|
|
|
{% else %}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
},
|
|
|
|
"Logging":
|
|
|
|
{
|
|
|
|
"loggers": [
|
|
|
|
{
|
|
|
|
"name": "kea-dhcp4",
|
|
|
|
"output_options": [
|
|
|
|
{
|
2018-09-20 17:06:03 +02:00
|
|
|
"output": "/var/log/kea/kea-dhcp4.log"
|
2017-12-28 22:10:09 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"severity": "WARN",
|
|
|
|
"debuglevel": 0
|
2018-09-20 17:06:03 +02:00
|
|
|
}
|
2017-12-28 22:10:09 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|