Foreman and FreeRADIUS


We're thinking on a way of automating the VLAN configuration for the
servers that we install with foreman. The idea is to use the VLAN parameter
in the network interfaces or a custom parameter at a host level plus the
mac address to identify the server on the switches and have them to
configure the right vlan on that port.

We are specifically looking at this:
which uses FreeRadius to make that connection. In this example they use a
file database that essentially contains the mac-vlan relationship.

Now, I would like to get that information from foreman instead, some of the
solutions we are considering:

  • Generate the database file through an script that gets that information
    from the API. Schedule the execution of the script via cron.
  • Use FUSE to mount a dynamically generated file that uses API queries to
    generate the file contents on the fly overriding the read method for that
  • To use a mysql backend for radius and have a "hook" of some sort that
    executes an insert/delete upon creation/deletion of the host in foreman.

Is there a better solution for this? Any suggestion will be highly