Foreman smart proxy DHCP with correct IP address?

Using Foreman 3.7 I’d like to know if it’s possible to have the Foreman smartproxy give the correct IP to a host that’s being built?

My situation is, I am using DHCP for initial boot only. Actually I would like to make Foreman’s DHCP smart enough to not offer DHCP leases except to hosts that are being built.

I was surprised this wasn’t the default configuration, actually. Is there a way to make it happen?

(When hosts that aren’t being built reboot from NIC and get a DHCP lease, they pxeboot, and the default pxeboot config then tells them to boot from local hard disk. But it would be faster if they would just fail to get a lease in the first place so they could fall back to local boot directly without going through pxeboot first.)

I’m manually assigning IPs to hosts during provisioning in Foreman, but when I first set up a smartproxy to do DHCP, it failed to give any lease at all until I configured a DHCP range (pool). So now that I’ve done that, it will give a lease, and then the DHCP IP gets overwritten with the statically configured IP during the provisioning templates.

It would also be nice not to have to set the DHCP pool for each separate smart proxy. Again, I was surprised Foreman didn’t do this automatically. (I set in in the foreman_proxy installer class, which I have running as part of my puppet codebase.)

Any advice on these points?

I haven’t tested it, but you might get some results if you set the IPAM in a subnet to ‘None’. According to the tooltip:

You can select one of the IPAM modes supported by the selected IP protocol:

    DHCP - will manage the IP on DHCP through assigned DHCP Capsule, auto-suggested IPs come from DHCP (IPv4)
    Internal DB - use internal DB to auto-suggest free IP based on other interfaces on same subnet respecting range if specified, useful mainly with static boot mode (IPv4, IPv6), preserves natural ordering
    Random DB - same as Internal DB but randomizes results to prevent race conditions (IPv4)
    EUI-64 - will assign the IPv6 address based on the MAC address of the interface (IPv6)
    External IPAM - will auto-suggest the next available address via an External IPAM Capsule plugin (IPv4, IPv6)
    None - leave IP management solely on user, no auto-suggestion (IPv4, IPv6)

That seems to me that it will not assign IP addresses to systems it does now know already.

Thanks; I already have IPAM set to “None” so I guess that isn’t it.

This isn’t really a crucial problem though, as with the default pxe config hosts that aren’t being bulit will just get the pxeboot telling them to boot locally. I will just live with that for now.