I am trying to deploy Ubuntu 22.04 with Foreman v 3.5 running on Nginx, I am specifically having issue with the dynamic userdata API portion which works if I specify the mac address in teh PXELinux APPEND statement as such: ds=nocloud;s=http://<%= foreman_request_addr %>/userdata/<%= @host.mac %>/
But according to my research and other posts on the forum, the intended was should not require the mac address since Foreman API will serve the right userdata based on the requester?- ds=nocloud;s=http://<%= foreman_request_addr %>/userdata/
We have a proxy running on the Foreman server itself and it appears the userdata API is accessible if I speicfy the MAC address from port 80 and 3000 but not 8000 which is where the proxy is Listening. Example- curl -D - -H 'X-FORWARDED-FOR: <pxeboot_client>' http://foreman.example.com/userdata/<mac_address> /user-data
log I see in the production.log-
[I|app] Started GET "/userdata/user-data for <client_ip> at 2024-01-24 08:40:31 -0500
[I|app] Processing by UserdataController#userdata as TEXT
[E|app] Could not find host for request <client_ip>
[I|app] Rendered text template (Duration: 0.0ms | Allocations: 2)
[I|app] Filter chain halted as :find_host rendered or redirected
[I|app] Completed 404 Not Found in 12ms (Views: 0.3ms | ActiveRecord: 3.3ms | Allocations: 3100)
The client that is trying to get the template needs to have the IP address matching the host in the database. I don’t know if Ubuntu installer (the new one) allows customizing the user-data URL, if that is possible we could inject a UUID token and relax this requirenment.
In your Foreman version, you should use the non-MAC API endpoint and it should work fine for Foreman and Smart Proxy deployments. But, it is important that you follow the docs for your Smart Proxy-based deployment:
In case your DHCP-setup requires you to use the MAC-based endpoint and you want to deploy through your Foreman only, you should update your Foreman to get the latest templates. Alternatively, you can get the templates and snippets here: