You can use a microkernel extension to provision nodes based on hardware info or metadata that isn’t available by default in Facter.
When configured, all nodes receive the microkernel extension, which contains instructions for reporting custom facts to the Razor server. The custom facts can then be used to tag nodes, apply policies, and provision eligible nodes.
For example, if you want to provision machines based on hardware chassis or rack location – facts not available by default in Facter – you could create custom facts for these properties. Then, you can use the custom facts to create associated tags and policies that install the appropriate OS. For a detailed example of using a microkernel extension to report rack location, see Server locality using Razor and LLDP.
Creating custom facts for use with Razor is similar to creating custom facts for other Puppet uses. For more information about custom facts, see the Facter custom fact walkthrough.
On both new and existing nodes, the microkernel retrieves and unpacks the latest extension file before each checkin.
The content of the extension file is placed in a new, non-persistent directory on the microkernel image. Changes to the directory aren’t saved, and the directory is overwritten when a new extension file is available.
During unpacking, the executable bit on files is preserved. Permissions for the files in the extension are irrelevant, because the microkernel extension runs as root.
The Razor microkernel extension is a ZIP file with the default title
Depending on the requirements of the custom facts you’re using, the extension might include these directories:
|Directory||Contains||Environment variable modified|
Note: You can’t change environment variables other than
RUBYLIB. For example, static
FACTER_<factname> environment variables don’t work with the microkernel extension.
/etc/puppetlabs/razor-serveror, if you’ve changed the default, the location specified by the
microkernel_extension_zipparameter of the
pe-razoruser. For example, you can use
chmod 444 <FILENAME>to make the file readable by all users.
/tmpis a valid choice, because the data persists in that location as long as the microkernel extension is running.