Allow to config dhcp lease time

Add a new option,  dhcp_lease_time, that allows to config the default
lease time. The default value, 12h, is the same that was hardcoded
before.

Change-Id: I25c00345d098693913d12b6dc9a012c7399725da
This commit is contained in:
Ghe Rivero 2015-11-24 19:43:16 +01:00
parent 7ce4e9595d
commit 4fdd48cbab
3 changed files with 14 additions and 9 deletions

View File

@ -60,6 +60,10 @@ If you chose to utilize the dhcp server, You may wish to set default ranges:
dhcp_pool_start: 192.168.1.200
dhcp_pool_end: 192.168.1.250
And also set the default dhcp address lease time:
dhcp_lease_time: 12h
Alternatively, a user can choose to perform static DHCP assignments to nodes.
This can be enabled by setting the ``inventory_dhcp`` setting to ``true``.
This will result in the ``dhcp_pool_start`` and ``dhcp_pool_end`` settings

View File

@ -55,6 +55,7 @@ enabled_drivers: "agent_ipmitool,pxe_amt,agent_ilo,agent_ucs"
# since IP allocation will be static.
dhcp_pool_start: 192.168.1.200
dhcp_pool_end: 192.168.1.250
dhcp_lease_time: 12h
# Dnsmasq default route for clients. If not defined, dnsmasq will push to clients
# as default route the same IP of the dnsmasq server.
# Default: undefined

View File

@ -158,7 +158,7 @@ dhcp-hostsfile=/etc/dnsmasq.d/bifrost.dhcp-hosts.d
{% if testing %}
dhcp-range=192.168.122.2,192.168.122.254,12h
{% else %}
dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h
dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{{dhcp_lease_time}}
{% endif %}
{% endif %}
@ -189,11 +189,11 @@ dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h
#dhcp-range=1234::2, 1234::500, 64, 12h
# Do Router Advertisements, BUT NOT DHCP for this subnet.
#dhcp-range=1234::, ra-only
#dhcp-range=1234::, ra-only
# Do Router Advertisements, BUT NOT DHCP for this subnet, also try and
# add names to the DNS for the IPv6 address of SLAAC-configured dual-stack
# hosts. Use the DHCPv4 lease to derive the name, network segment and
# add names to the DNS for the IPv6 address of SLAAC-configured dual-stack
# hosts. Use the DHCPv4 lease to derive the name, network segment and
# MAC address and assume that the host will also have an
# IPv6 address calculated using the SLAAC alogrithm.
#dhcp-range=1234::, ra-names
@ -216,9 +216,9 @@ dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h
#dhcp-range=1234::, ra-stateless, ra-names
# Do router advertisements for all subnets where we're doing DHCPv6
# Unless overriden by ra-stateless, ra-names, et al, the router
# Unless overriden by ra-stateless, ra-names, et al, the router
# advertisements will have the M and O bits set, so that the clients
# get addresses and configuration from DHCPv6, and the A bit reset, so the
# get addresses and configuration from DHCPv6, and the A bit reset, so the
# clients don't use SLAAC addresses.
#enable-ra
@ -284,11 +284,11 @@ dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h
# any machine with Ethernet address starting 11:22:33:
#dhcp-host=11:22:33:*:*:*,set:red
# Give a fixed IPv6 address and name to client with
# Give a fixed IPv6 address and name to client with
# DUID 00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2
# Note the MAC addresses CANNOT be used to identify DHCPv6 clients.
# Note also the they [] around the IPv6 address are obilgatory.
#dhcp-host=id:00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2, fred, [1234::5]
#dhcp-host=id:00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2, fred, [1234::5]
# Ignore any clients which are not specified in dhcp-host lines
# or /etc/ethers. Equivalent to ISC "deny unknown-clients".
@ -346,7 +346,7 @@ dhcp-option=3,{{dnsmasq_router}}
# Send DHCPv6 option. Note [] around IPv6 addresses.
#dhcp-option=option6:dns-server,[1234::77],[1234::88]
# Send DHCPv6 option for namservers as the machine running
# Send DHCPv6 option for namservers as the machine running
# dnsmasq and another.
#dhcp-option=option6:dns-server,[::],[1234::88]