Show Table of Contents
11.4. Extending the Discovery Image
It is possible to extend the Satellite Discovery image with custom facts, software, or device drivers. You can also provide a compressed archive file containing extra code for the image to use.
First, create the following directory structure:
. ├── autostart.d │ └── 01_zip.sh ├── bin │ └── ntpdate ├── facts │ └── test.rb └── lib ├── libcrypto.so.1.0.0 └── ruby └── test.rb
autostart.ddirectory contains scripts that are executed in POSIX order by the image when it starts, but before the host is registered to Satellite.
bindirectory is added to the $PATH variable; you can place binary files here and use them in the autostart scripts.
factsdirectory is added to the FACTERLIB variable so that custom facts can be configured and sent to Satellite.
libdirectory is added to the LD_LIBRARY_PATH variable and
lib/rubyis added to the RUBYLIB variable, so that binary files in
/bincan be executed correctly.
New directives and options are appended to the existing environment variables (PATH, LD_LIBRARY_PATH, RUBYLIB and FACTERLIB). If you need to specify the path to something explicitly in your scripts, the zip contents are extracted to the
/opt/extensiondirectory on the image.
After creating the above directory structure, package it into a zip archive with the following command:
zip -r my_extension.zip .
You can create multiple zip files but be aware they will be extracted to the same place on the Discovery image, so files in later zips will overwrite earlier ones if they have the same file name.
To inform the Discovery image of the extensions it should use, place your zip files on your TFTP server with the Discovery image, and then update the APPEND line of the PXELinux template with the
fdi.zipsoption where the paths are relative to the TFTP root. For example, if you have two archives at
$TFTP/boot/zip2.zip, use the following syntax:
See Section 11.1.2, “Configuring PXE-booting” for more information on updating the PXE template.