Can foreman match bare-metal machines based on labels like MAC, UUID, etc


I am trying to see if Foreman is a viable option for pxe booting CoreOS container linux. We currently have a set up that’s working but we would really like to have a central point of management like Foreman for all of our needs.

We are currently using matchbox and wanted to know if Foreman can do something similar. matchbox is a service that matches bare-metal machines (based on labels like MAC, UUID, etc.) to profiles that PXE boot and provision Container Linux clusters.

Is anyone doing this type of thing with Foreman and can maybe point me in the right direction.

Hello, yes you could use a “Discovery Rule” to specify the MAC or MAC pattern to be matched. You of course need to have the MAC address defined in your DHCP server to get the “next server” variable to point you to Foreman. Hope this helps.

Yes that’s a good start. In the Discovery Rules, I assume this would happen in the “search” field? And what would that search look like mac ~ “some MAC address”

Yes the “Search” field.

Here are 2 patterns from 2 discovery rules that I use for Cisco UCS B200M4 blade servers and ESXi VMs respectively:
mac~ 00:25:B5*
mac ~ 00:50:56:0f:03*


Note that mac ˜ xyz only searches by mac of a primary interface. In case of discovery, that’s usually same as provision interface and is in fact interface on which it booted the FDI. If you’d need to ever search by all interfaces mac, use has_mac ~ xyz

Hey Marek,
Thank you for that. I wasn’t aware of that as my implementation is modestly not too complex so I’ve not yet had to search any interfaces other than the provisioned one as of yet.


What was said, discovery image can be injected with custom facts if you want some custom UUID or BIOS vendor numbers. However they should be present already.