Feature #34887
closeduserdata controller should be able to look up host by MAC address
Description
Currently, the /userdata/(user|meta)-data route required e.g. for subiquity-installations of Ubuntu is only able to determine the Foreman host by IP address, i.e. the userdata controller uses request.remote_ip and then looks up a host that has this IP address set on its interface.
In many environments this is not practical (undetermined IP address, NAT, ...).
Therefore, we propose the ability (similar to the unattended controller) to be able to specify the MAC address of the NIC via the userdata template URL. Since GET parameters are not applicable when using subiquity (subiquity expects a URL that it will append the strings "user-data" and "meta-data" to), we instead propose making a MAC address an optional component in the userdata route; for example:
<foreman-server>/userdata/user-data # this is the current bevahior and will look up the host by IP address if applicable
and new:
<foreman-server>/userdata/11:22:33:44:55:66/user-data # this will look up the host by MAC address instead.
A PR on Gitlab implementing this extended behavior will be provided.