extract dhcp-failover.conf into separate file
This commit is contained in:
parent
d323b78c16
commit
51fdb89940
3 changed files with 41 additions and 34 deletions
|
@ -15,7 +15,15 @@
|
||||||
dest: /etc/default/isc-dhcp-server
|
dest: /etc/default/isc-dhcp-server
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
- name: Configure isc-dhcp-server
|
|
||||||
|
- name: Configure dhcp-failover.conf
|
||||||
|
template:
|
||||||
|
src: dhcp/dhcp-failover.conf.j2
|
||||||
|
dest: /etc/dhcp/dhcp-failover.conf
|
||||||
|
mode: 0600
|
||||||
|
when: dhcp_failover is defined
|
||||||
|
|
||||||
|
- name: Configure dhcpd.conf
|
||||||
template:
|
template:
|
||||||
src: dhcp/dhcpd.conf.j2
|
src: dhcp/dhcpd.conf.j2
|
||||||
dest: /etc/dhcp/dhcpd.conf
|
dest: /etc/dhcp/dhcpd.conf
|
||||||
|
|
31
roles/isc-dhcp-server/templates/dhcp/dhcp-failover.conf.j2
Normal file
31
roles/isc-dhcp-server/templates/dhcp/dhcp-failover.conf.j2
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
failover peer "dhcp-failover" {
|
||||||
|
{% if inventory_hostname == dhcp_failover.primary_host %}
|
||||||
|
primary;
|
||||||
|
|
||||||
|
# MCLT = Maximum Client Lead Time.
|
||||||
|
# Must be specified on the primary, forbidden on the secondary.
|
||||||
|
mclt 3600;
|
||||||
|
|
||||||
|
# Address or DNS name on which this node listens for connections
|
||||||
|
# from its failover peer.
|
||||||
|
address {{ dhcp_failover.primary_host }};
|
||||||
|
peer address {{ dhcp_failover.secondary_host }};
|
||||||
|
|
||||||
|
# Load balancing.
|
||||||
|
split 128;
|
||||||
|
{% endif %}
|
||||||
|
{% if inventory_hostname == dhcp_failover.secondary_host %}
|
||||||
|
secondary;
|
||||||
|
# Address and peer address are reversed on the secondary node.
|
||||||
|
address {{ dhcp_failover.secondary_host }};
|
||||||
|
peer address {{ dhcp_failover.primary_host }};
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
# The following options can be shared between primary and
|
||||||
|
# secondary failover peers.
|
||||||
|
port 647;
|
||||||
|
peer port 647;
|
||||||
|
max-response-delay 30;
|
||||||
|
max-unacked-updates 10;
|
||||||
|
load balance max seconds 3;
|
||||||
|
}
|
|
@ -30,40 +30,8 @@ authoritative;
|
||||||
|
|
||||||
# TODO: move this failover peer declaration to a separate file and include it.
|
# TODO: move this failover peer declaration to a separate file and include it.
|
||||||
{% if dhcp_failover is defined %}
|
{% if dhcp_failover is defined %}
|
||||||
failover peer "dhcp-failover" {
|
include "/etc/dhcp/dhcp-failover.conf";
|
||||||
{% if inventory_hostname == dhcp_failover.primary_host %}
|
|
||||||
primary;
|
|
||||||
|
|
||||||
# MCLT = Maximum Client Lead Time.
|
|
||||||
# Must be specified on the primary, forbidden on the secondary.
|
|
||||||
mclt 3600;
|
|
||||||
|
|
||||||
# Address or DNS name on which this node listens for connections
|
|
||||||
# from its failover peer.
|
|
||||||
address {{ dhcp_failover.primary_host }};
|
|
||||||
peer address {{ dhcp_failover.secondary_host }};
|
|
||||||
|
|
||||||
# Load balancing.
|
|
||||||
split 128;
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if inventory_hostname == dhcp_failover.secondary_host %}
|
|
||||||
secondary;
|
|
||||||
# Address and peer address are reversed on the secondary node.
|
|
||||||
address {{ dhcp_failover.secondary_host }};
|
|
||||||
peer address {{ dhcp_failover.primary_host }};
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# The following options can be shared between primary and
|
|
||||||
# secondary failover peers.
|
|
||||||
port 647;
|
|
||||||
peer port 647;
|
|
||||||
max-response-delay 30;
|
|
||||||
max-unacked-updates 10;
|
|
||||||
load balance max seconds 3;
|
|
||||||
}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Bornes WiFi
|
# Bornes WiFi
|
||||||
subnet 10.{{ subnet_ids.ap }}.0.0 netmask 255.255.0.0 {
|
subnet 10.{{ subnet_ids.ap }}.0.0 netmask 255.255.0.0 {
|
||||||
|
|
Loading…
Reference in a new issue