How to Force Foreman 1.7.1 to Update dhcp.leases file

I find myself in the following situation.

I added about 36 hosts yesterday to foreman using the web interface. At the
time I did not realize that foreman was not properly configured (after an
upgrade) to talk to the dhcp server.

Today I addressed the dhcp server connection issue and resolved it. Now all
new hosts that I configure in foreman are properly added to the
dhcpd.leases file.

However I have a problem in that 34 of those 36 hosts that are in foreman
are simply not being added to the dhcpd.leases file.

Clearly when you add a new host via the web interface some mechanism is
triggered that causes foreman to contact the dhcp server and to get it to
update its dhcpd.leases file that is not occurring with existing hosts.

Is it possible and if so how do I trigger foreman to add all of my existing
hosts to the dhcpd.leases file? Is it something that can be done from the
command line via hammer?

Thanks for any suggestions.

Terrence

> Is it possible and if so how do I trigger foreman to add all of my existing
> hosts to the dhcpd.leases file? Is it something that can be done from the
> command line via hammer?
>
> Thanks for any suggestions.

Although this could be possible I'd recommend you to simply edit the
leases file manually. IMHO it will take the same amount of time than
coming up with a script.

If you want to give it a try, I'd suggest a loop over your hosts in our
rails console and calling DHCP API.

ยทยทยท -- Later, Lukas #lzap Zapletal