Deploying Software After Reboot Using Modular Salt States in SystemLink

Updated Jul 23, 2025

Environment

Software

  • SystemLink

Operating System

  • Windows

Overview

This guide explains how to structure and deploy SaltStack states in SystemLink Server to handle workflows that require a Windows system reboot before installing software. By breaking the process into modular Salt states and orchestrating them using the include directive, you gain better control and visibility over each step in the SystemLink Jobs interface.

 

The example provided uses OpenSSH Server to demonstrate the approach, but the same pattern applies to any software installation that depends on a reboot. This method ensures that each state is tracked individually, avoids redundant execution after reboot, and supports maintainable, reusable configurations across multiple systems.

Steps

To ensure SystemLink can reliably track each stage of a SaltStack workflow—especially across reboots—you can split your configuration into modular states and orchestrate them using the include directive. This design improves visibility in the Jobs interface and prevents repeated execution of completed steps.

 

Create Modular Salt States

To implement modular Salt states in SystemLink, you’ll need to create each .sls file and either import them into SystemLink or create them directly using the web interface.

 

Option A: Create Raw States in SystemLink
  1. Log in to SystemLink Server.
  2. Go to Systems Manager > System States.
  3. Click Create State and enable Show Raw State.
  4. Paste your Salt state content and save.

 

Option B: Import .sls Files
  1. Log in to SystemLink Server.
  2. Go to Systems Manager > System States.
  3. Click Import, then Browse... to upload the SLS file.

 

Use an Entry-Point State with include

Create a main state file (e.g., Main.sls) that includes your modular states:

 

include:
  - State_A
  - State_B
The include directive allows you to reference other state files within a parent state, enabling modular and maintainable configurations. Learn more in the SaltStack Include Function Documentation.
 

Deploy the Main State in SystemLink

  1. Go to Systems in SystemLink.
  2. Select the target client system(s).
  3. Open the Software tab, then the States sub-tab.
  4. Locate your Main state and click Install.
  5. Review and apply the state.

 

SystemLink will execute the included states in order, and each will be tracked individually in the Jobs interface. For full deployment instructions, see: Deploying System States to Clients 

Result

By organizing your SaltStack configuration into modular states and deploying them through a single entry-point state using the include directive, SystemLink can track each step of the process—such as reboots and software installations—individually in the Jobs interface. This ensures that completed steps are not repeated after a reboot, improves visibility into the deployment workflow, and supports more maintainable and reusable configurations. 

Example

This example demonstrates how to structure a SaltStack workflow in SystemLink to conditionally reboot a Windows system and then install and configure OpenSSH Server. The same pattern can be adapted for other software installations that require a reboot beforehand.

 

Reboot_System.sls

This state ensures that the system is rebooted before the software installation.

reboot_system:
  module.run:
    - name: system.reboot
    - in_seconds: true
    - order: first
    - timeout: 60
    - wait_for_reboot: true

 

Install_OpenSSH_Server.sls

This state installs and configures the OpenSSH Server using PowerShell commands. You can replace this logic with any other software installation steps.

install_openssh_server:
  cmd.run:
    - name: >
        Set-ExecutionPolicy Unrestricted;
        Add-WindowsCapability -Online -Name 'OpenSSH.Server~~~~0.0.1.0';
        Set-Service -Name sshd -StartupType Automatic;
        Start-Service sshd;
    - shell: powershell

 

Main.sls

This is the entry-point state that includes the two modular states above. When deployed, SystemLink will execute them in order and track each step individually.

include:
  - Reboot_System
  - Install_OpenSSH_Server

 

To deploy this example, follow the general deployment steps outlined earlier.