Deleting a provisionned host, then rediscover and reprovision fails at DHCP

Problem:
When I delete a host and rediscover it then reprovision with the same DNS name, dhcp proxy fails by saying duplicate entry.

I have to edit /var/lib/dhcpd/dhcpd.leases and manually remove the entry for the mac.

Expected outcome:

When rebuilding or recreating, dhcp is able to either reuse a still valid dhcp lease or at least overwrite the previous information without breaking.

Foreman and Proxy versions:

Foreman 2.4 with Katello 4.0

Distribution and version:

Installed on RHEL 7

You should configure your DHCP not to intersect with DHCP reservation range in foreman.

This is documented, granted this is buried down at the two places:

https://theforeman.org/manuals/2.4/index.html#3.2.3InstallationScenarios

and

https://theforeman.org/plugins/foreman_discovery/15.0/index.html

I am taking this into the new documentation:

From the new paragraph proposal:

Ensure that DHCP range of all subnets where discovery is planned do not intersect with DHCP lease pool configured for the managed DHCP service.
DHCP range is set in web interface while lease pool range is set via {foreman-installer}.
For example, in a 10.1.0.0/16 network range 10.1.0.0 to 10.1.127.255 could be allocated for leases and 10.1.128.0 to 10.1.255.254 could be allocate for reservations.

Ok so the Discovery range must be distinct from the provisioning range?

I discover hosts using PXE Boot and the Foreman DHCP is the one responsible for DHCP on discovery and then Provisioning on the same subnet with same Foreman DHCP.

From what I understand, the range given when installing Foreman with ‘–foreman-proxy-dhcp-range’ would be used for provisioning and the range given in the web interface would be used for Discovery?

So for Provisioning using Foreman I should create a Subnet with IPAM set to DHCP and the range configured so as to not overlap the range I put in ‘–foreman-proxy-dhcp-range’, is that right?

Thank you.