diff --git a/README.md b/README.md index 1d87d0544b346c73420bac3c03abbb86f27b90e7..a58bd1a79647e7994c0c5712eca0066471a0e24c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,18 @@ Requirements Variables --------- -*todo* +* kea_ha_mode + * description: + * This option defines the high availabilty mode. + * If this option is set to *loadbalancing* the *dhcp_primary_server* is the primary server and the *dhcp_secondary_server* is the secondary server. All other servers of this host group are backup server. + * If this option is set to *hotstandby* the *dhcp_primary_server* is the active server and the *dhcp_secondary_server* is the standby server. All other servers of this host group are backup server. + * choices: [none, loadbalancing, hotstandby] + * default: none + +* kea_control_agent_port + * description: + * This option defines the communication port for the kea control agents. + * default: 8080 Processes ========= diff --git a/templates/kea-dhcp-ha.j2 b/templates/kea-dhcp-ha.j2 index af208a5bb72dd9c289dbe2d057b48fac35fe8c8a..2ffda2e841f53b1d2c20a403020a9d34a3a1f4e2 100644 --- a/templates/kea-dhcp-ha.j2 +++ b/templates/kea-dhcp-ha.j2 @@ -6,9 +6,9 @@ {%- for ifname, ifdata in nodenetwork.devices.items() if ifdata.services is defined and ("dhcp-ha" in (ifdata.services | default([]))) %} {%- set has = {"name": fctnhst} {%- if ipversion == "ipv4" %} -{%- do has.update({"url": 'http://%s:%s/' | format(ifdata.ipv4 | default("127.0.0.1"), kea_ha_port)} %} +{%- do has.update({"url": 'http://%s:%s/' | format(ifdata.ipv4 | default("127.0.0.1"), kea_control_agent_port)} %} {%- else %} -{%- do has.update({"url": 'http://[%s]:%s/' | format(ifdata.ipv6 | default("::1"), kea_ha_port)} %} +{%- do has.update({"url": 'http://[%s]:%s/' | format(ifdata.ipv6 | default("::1"), kea_control_agent_port)} %} {%- endif %} {%- if fctnhst != dhcp_primary_server or fctnhst != dhcp_secondary_server %} {%- do has.update({"auto-failover": false, "role": "backup"}) %} @@ -26,7 +26,7 @@ {%- endif %} {%- endfor %} -{%- if (ha_servers | length) > 0 -%} +{%- if (ha_servers | length) > 1 -%} "hooks-libraries": [ { "library": "/usr/lib/hooks/libdhcp_lease_cmds.so",