I think the magic of this patch (again, props to @frimik for the idea) is that you add all those values to the settings file and this file becomes static. Since it's logic pure logic, it could even be moved to /usr/bin/foreman-external_nodes or something along those lines.