Rake models::consolidate


rake models::consolidate[dryrun]


This utility reads the config/model.mappings file and scans through the current Models in the Foreman database, consolidating models that match a regular expression into a single Model. It will also automatically assign the correct vendor class and hardware model to Sun Sparc based systems. These last two values are required by the Sparc Jumpstart mechanism and are used to initialize a Sparc host's DHCP entries. Hosts that do not pass validation will also be reported together with the the Models that were not matched by the mappings file.

Note that the unattended option must be turned off in config/settings.yaml before running this utility.


dryrun - Do not perform the consolidation just report invalid hosts and the Models that were not matched.


When Foreman comes across a new host that has not been configured and built by Foreman it will associate the host with a Model that it constructs by looking at the host's facts. This can sometimes create a Model name that is inappropriate or badly named. For instance a FujitsuSiemens PrimePower 400 would be associated with a Model called GPUZC-M, (as this is what facter returns as the host's model.) The consolidate task would rewrite this Model to be called FS PrimePower 400 and set that Model's vendor class to be GPUZC-M and its hardware model to be SUN4US.

Some vendors also return a slightly different model for each board revision of their product so you may see a list of very similar model names with just the last few characters differing. This task will match these names against a regular expression and merge them into a single Model.

Model_mappings file

This file contains a sequence of yaml descriptions of a model. Each entry also has a regular expression that is used to match the name of a facter-generated name. When the current name in the Foreman database is matched then the current contents of that Model are changed to this mapping and any associated hosts are switched to using this model.

E.G. This entry will convert all hosts that have a model matching /Sun-Fire-V125/ to use the Sun V125 model and these hosts will have a Sparc vendor class of Sun-Fire-V125 and Sparc hardware model of SUN4U.

- name: Sun V125
vendor_class: Sun-Fire-V125
info: SUN V125 specific notes
hardware_model: SUN4U
rex: Sun-Fire-V125