@tom-elliott said in Quick host registration is registering my computers with the Mac address as the hostname:
I’ve not added any special strings as it actually adds quite a bit of complexity to the overall workflow.
While it’s not “overly” hard to add such a feature, I think this is something more in line with a user being able to edit and figure out.
First, you have to understand, you have to detect your “special” strings and replace them with the corresponding value. During Quick Registration, we haven’t quite gotten the inventory of the host yet, until after the host has been registered. It shouldn’t be too hard to add, but again it’s not a simple thing either.
And where do we “stop”. For example, what strings should we allow, vs, not allow?
The file you can edit, if you’d like to try adding this feature again, is located (with 1.4.4 at least) /var/www/fog/lib/reg-task/registration.class.php There’s two methods, _quickRegAuto and _quickReg, you’d want to modify the _quickRegAuto specifically.
You’ll notice that inventory isn’t taken into account here, and therefor using the inventory data for the hostname would have to be done within the init’s.
In particular, the init file /bin/fog.auto.reg would need to be modified after the inventory line.
I’m bringing this to your attention only because FOG has changed quite a bit since 0.29/0.3x days and while this feature may have been there in the past, we have tried to make things much more manageable in general. This means some features from olden times may have been removed due to the complexity involved.
Hopefully you understand.
@tom-elliott I understood most of the things that you said, but I am not sure what strings of the code should I have to change. Can you help me with that?