This example demonstrates Salt minions with Windows OS that have configured scheduler, beacon and reactor.
The configuration checks whether region and regional format settings have the expected values. For example, I used dashboards that were based on log data where timestamps differ based on region format, so I wanted an additional check on provisioned machines.
I found two approaches: the Salt way - using the reg
module (see blocks at bottom of common.sls), or the Windows way, using PowerShell script with the cmd.script
function in the salt state file. This document demonstrates the PowerShell approach, as reg
module documentation is already available in the official Salt docs.
The setup follows official Salt user guide documentation, with all relevant documentation in section below.
The scheduler job starts a PowerShell script, that checks and logs current state of locale region format on the minion. Based on the results, it will send log file in designated directories status / corrected / wrong
The scheduler triggers a check for current status and logs it's entry. The beacon (Watchdog) monitors these directories and when there is file modified in designated directory, the reactor triggers a correction script to adjust region format to the expected value.
If incorrect value is detected, it's recorded in the .log file stored in a specific directory that's monitored by the beacon (Watchdog). The reactor then executes a correction state file containing instructions to set the correct value.
You have Salt master installed and configured, Windows minion is able to ping master server with success.
⚠ To make Scheduler, Beacon, Reactor trio working: salt-minion must use 'Log On' service property and fill in the credentials into This account option. If you don't set that, it will result beacon not working and consequently reactor not working as well.
⚠ Ensure that you backed up your existing setup before you start with anything
I made sure essentials for scheduler, beacon and reactor are shared in the repository, purpose of this repository is to help you understand where should they be configured. We all have structure different, the only file placement that matters is one also described in the image. Reactor config must be set on master server while beacon config must be set on the minion along with scheduler.
- On salt master start
salt-run state.event pretty=true
- To test you can set scheduler and beacon interval to 20s both
- On the minion, set the locale region format to a value that is not expected
- Reactor config is configured -
master/master.d/reactor.conf
- Beacon config is set and applied -
salt/dev/saltproject/windows/conf/minion.d/beacons.conf
- Schedule config set and applied -
salt/dev/saltproject/windows/conf/minion.d/_schedule.conf
- Master service and minion service were both restarted. ⚠ If you forget to restart it won't work.
- Watch the
state.event
you'll see scheduler job first, following beacon and reactor
ℹ Help yourself also with the minion log that is by default located in:
C:\ProgramData\Salt Project\Salt\var\log\salt\minion
Tested (21.04.2025) on minion, which was based on version: 3007.1
Scheduler:
- https://docs.saltproject.io/salt/user-guide/en/latest/topics/scheduler.html
- https://docs.saltproject.io/en/latest/ref/states/all/salt.states.schedule.html
Beacons:
- https://docs.saltproject.io/salt/user-guide/en/latest/topics/beacons.html
- https://docs.saltproject.io/en/latest/ref/states/all/salt.states.beacon.html
Reactor:
- https://docs.saltproject.io/salt/user-guide/en/latest/topics/reactors.html
- https://docs.saltproject.io/en/latest/topics/reactor/
- https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.reg.html
- https://docs.saltproject.io/en/latest/ref/states/all/salt.states.cmd.html
- https://learn.microsoft.com/en-us/windows/win32/intl/table-of-geographical-locations
- https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-international-core-userlocale
Saltstack is available at: https://github.com/saltstack/salt / https://saltproject.io/
License: https://github.com/saltstack/salt?tab=Apache-2.0-1-ov-file
Kudos to Salstack Windows workgroup for helping me out through this journey!
PowerShell scripts are my own creation.
The use of scripts or shared content is solely at your own risk. I do not guarantee its accuracy, reliability, or suitability for your specific needs. No responsibility is taken for any damages or losses that may result from its use. It is recommended that you carefully review and test the content before implementation!