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_start: 192.168.1.200
dhcp_pool_end: 192.168.1.250 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. 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 can be enabled by setting the ``inventory_dhcp`` setting to ``true``.
This will result in the ``dhcp_pool_start`` and ``dhcp_pool_end`` settings 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. # since IP allocation will be static.
dhcp_pool_start: 192.168.1.200 dhcp_pool_start: 192.168.1.200
dhcp_pool_end: 192.168.1.250 dhcp_pool_end: 192.168.1.250
dhcp_lease_time: 12h
# Dnsmasq default route for clients. If not defined, dnsmasq will push to clients # Dnsmasq default route for clients. If not defined, dnsmasq will push to clients
# as default route the same IP of the dnsmasq server. # as default route the same IP of the dnsmasq server.
# Default: undefined # Default: undefined

View File

@ -158,7 +158,7 @@ dhcp-hostsfile=/etc/dnsmasq.d/bifrost.dhcp-hosts.d
{% if testing %} {% if testing %}
dhcp-range=192.168.122.2,192.168.122.254,12h dhcp-range=192.168.122.2,192.168.122.254,12h
{% else %} {% else %}
dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{{dhcp_lease_time}}
{% endif %} {% endif %}
{% endif %} {% endif %}