Callbacks and post-install operations#

MetalSoft offers two major ways to customize the deployment process:

  1. Using workflows

  2. Using unattended install scripts

Using Workflows to call outside systems#

To interact with outside systems as part of deployment processes MetalSoft provides the Workflows mechanism.

There are two types of workflows:

  1. Infrastructure -> can be applied to certain infrastructures but the user has to select them in the infrastructure editor (or added via APIs).

  2. Global -> automatically added to all deploys either at the start or the end of the flow.

Add a deployment finished callback#

The following example will add a call to an external system as a deployment finished callback.

Create an HTTP task for callback#

  1. go to Workflows section and click Add task button.

  2. From the dropdown select HTTP request

  3. Fill in the required information.

  4. From the list select the newly created task and from the Overview tab select Visibility: Public from the dropdown.

Create a global workflow and add the task#

  1. go to the Workflows tab. Click Add Workflow.

  2. Fill in the required information. Select Global as option for the Usage field.

  3. Check the Automatically add the task to post-deploys. checkbox.

  4. Select the newly created workflow and go to Workflow Editor tab.

  5. Click on New Task item in the flow, select the desired task.

The task will now be added to every deploy. If you need to disable the workflow but not delete it uncheck the “Automatically add the task to post-deploys””.

For more information visit Workflows section.

Customizing operating system templates behavior#

In many situations users want to change the way operating systems get installed, the settings they use, the SSH keys deployed, etc. MetalSoft provides a robust mechanism for customizing this behavior.

How OS deployment works#

MetalSoft Operating System deployment mechanism uses the unattended install process of each OS vendor and as such the configuration files differ from OS to OS but the process is more or less the same:

  1. A copy of the original ISO is made

  2. Several dynamic configuration files are compiled with data regarding the target server during which variables mentioned in the configuration file templates are replaced with the correct values such as the WAN IP.

  3. The compiled files are injected into the new ISO.

  4. The iso is downloaded to the agent

  5. The server or switch is instructed to boot from it

  6. The server uses the unattended install files to perform the installation automatically

  7. MetalSoft awaits until the server is shutdown to mark the server as deployed

Changing the unattended install file#

To change an unattended install process, for example to add a post-install command, go to Templates > select template > Assets

In this screenshot you notice the source ISO and also the files that will get injected.

Click on preseed.cfg then go to Content tab.

The syntax of this file depends on the operating system. In this screenshot it is a Debian preseed file.

Notice the use of variables such as {{wan_interface_0_ipv4_ip_0_address}}. These get replaced during the compilation phase. See The variables glossary for a list of variables that gets passed during compilation.

Note that there are two types of template files:

  • Simple - only variable replacement takes place

  • Advanced - a Nunjucks- based language can be used that includes support for if-else,for etc.

By editing this file you can add post-install steps and alter the way the default deployment happens. Don’t forget to click Save.

For more information consult: OS Templates section.