diff --git a/playbooks/roles/bifrost-ironic-install/README.md b/playbooks/roles/bifrost-ironic-install/README.md index 35a2b3895..67bc611c4 100644 --- a/playbooks/roles/bifrost-ironic-install/README.md +++ b/playbooks/roles/bifrost-ironic-install/README.md @@ -67,8 +67,15 @@ 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 -being ignored and the ``ipv4_address`` setting being bound to the first -listed MAC address for the node. +only being used to define the range of valid ips to be accepted, and the +``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: diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index c9edfc9cc..770c31d74 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -56,6 +56,7 @@ enabled_drivers: "agent_ipmitool,pxe_amt,agent_ilo,agent_ucs" dhcp_pool_start: 192.168.1.200 dhcp_pool_end: 192.168.1.250 dhcp_lease_time: 12h +dhcp_static_mask: 255.255.255.0 # 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 diff --git a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 index 62e52386f..96656bad3 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 @@ -156,6 +156,8 @@ dhcp-hostsfile=/etc/dnsmasq.d/bifrost.dhcp-hosts.d # service. {% if testing %} 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 %} dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},{{dhcp_lease_time}} {% endif %}