Callbacks and post-install operations¶
MetalSoft offers two major ways to customize the deployment process:
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:
Infrastructure -> can be applied to certain infrastructures but the user has to select them in the infrastructure editor (or added via APIs).
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¶
go to Workflows section and click Add task button.
From the dropdown select HTTP request
Fill in the required information.
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¶
go to the Workflows tab. Click Add Workflow.
Fill in the required information. Select Global as option for the Usage field.
Check the Automatically add the task to post-deploys. checkbox.
Select the newly created workflow and go to Workflow Editor tab.
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:
A copy of the original ISO is made
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.
The compiled files are injected into the new ISO.
The iso is downloaded to the agent
The server or switch is instructed to boot from it
The server uses the unattended install files to perform the installation automatically
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.