Merge "Fix dhcp range for static inventory"

This commit is contained in:
Jenkins 2015-12-10 18:17:15 +00:00 committed by Gerrit Code Review
commit 61850681ab
3 changed files with 12 additions and 2 deletions

View File

@ -67,8 +67,15 @@ 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
being ignored and the ``ipv4_address`` setting being bound to the first only being used to define the range of valid ips to be accepted, and the
listed MAC address for the node. ``ipv4_address`` setting being bound to the first listed MAC address for
the node.
If you choose to use the static DHCP assignments, you may need to set
the ``dhcp_static_mask`` setting according to your needs. It defaults to
a /24 range.
In the case of static inventory, please also consider to set the
``dhcp_lease_time`` setting to infinite, to avoid unnecessary refreshes
of ips.
In case your HW needs a kernel option to boot, set the following variable: In case your HW needs a kernel option to boot, set the following variable:

View File

@ -56,6 +56,7 @@ enabled_drivers: "agent_ipmitool,pxe_amt,agent_ilo,agent_ucs"
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 dhcp_lease_time: 12h
dhcp_static_mask: 255.255.255.0
# 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

@ -156,6 +156,8 @@ dhcp-hostsfile=/etc/dnsmasq.d/bifrost.dhcp-hosts.d
# service. # service.
{% 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
{% elif inventory_dhcp %}
dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},static,{{dhcp_static_mask}},{{dhcp_lease_time}}
{% else %} {% else %}
dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{{dhcp_lease_time}} dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{{dhcp_lease_time}}
{% endif %} {% endif %}