Cloud-init installation with DHCP

I experienced that the user-data is only rendered if there is an IP address configure in Interfaces GUI.
We usually install our hosts via DHCP and foreman is not the DHCP server.
So, at the moment I have to start the machine and check what IP it receives from DHCP, add the IP to the host configuration and then I’m able to install.

Expected outcome:

Foreman and Proxy versions:
Version 3.3.1 for all

Foreman and Proxy plugin versions:

Distribution and version:
CentOS Linux release 7.9.2009

Other relevant data:

the same situation in Foreman 3.4.0 and Ubuntu 20.04

Hi, is there any progress on this topic?

To clarify, you want to use foreman just for the cloud-init template? You are not using the DHCP service, or creating & configuration a host, or any other foreman functions.

I could be wrong, but I don’t think that is currently possible. The closest to what you are doing is Discovery Service + Auto Provisioning

You could create a dummy host with dummy nic configuration, and then configure your other DHCP to point to cloud-init template url for that host. That is assuming the template contains only static information. Definitely not recommending doing that.

I’m using all features of foreman except the DHCP service because we have our own DHCP server as appliance.
I have ~1000 hosts in different VLANs.

I see. You could configure DHCP appliance to PXE boot hosts into discovery image > shows in foreman as discovered host > provision into a host either manually or auto > servers reboots/kexec into install. Essentially Discovery Service, but with external DHCP server. That should work, but to be franked I have not tried using it yet and can’t be more helpful.