Skip to content

Modules

Modules are the units of work in glidesh. Each module follows a two-phase check/apply pattern for idempotency.

Every module implements two operations:

  1. check — inspects the current state of the target and returns one of:

    • Satisfied — the desired state already matches, no action needed
    • Pending — changes are required
    • Unknown — state cannot be determined
  2. apply — performs the actual change on the target

With --dry-run, check decides the outcome: a task is reported as would change when its check returns Pending, and the plan that check produced is the reason shown against it. apply is still invoked, but it is told the run is a preview and only describes the command it would have run, so nothing on the target is modified.

A task in a step triggered by subscribe is no exception: its check is told the step was triggered, and returns Pending when the module would redo its work — a restart, a recreate, a rerun — so a preview counts exactly what the real run does.

A built-in module accepts only the parameters its page lists. Any other — a typo such as mdoe=, or a parameter from another tool — is an error that glidesh validate reports, and that run reports before it connects, rather than being ignored. External modules receive every parameter as written.

Because modules check before acting, plans are safe to run repeatedly. If a package is already installed, the package module reports Satisfied and skips it. If a service is already running, systemd reports Satisfied. Only the delta is applied. Idempotency & Drift lists what each module compares, and how to preview a run with --dry-run and --diff.

Module Description
shell Run arbitrary shell commands
host Run once on the controller (or a chosen host) and share the result with every target
package Install or remove system packages
user Manage system users and groups
systemd Control systemd services
container Manage containers (Docker/Podman)
file Transfer files, templates, and fetch
disk Format and mount block devices
nix Cross-distro Nix packages and environments

Community and custom modules can extend glidesh via the external module plugin system. External modules are standalone executables that communicate over a JSON-over-stdio protocol. They use the external keyword in plans:

step "Configure nginx" {
external "acme/nginx-vhost" "mysite" server_name="example.com"
}

See Writing Plugins for how to build your own.