Skip to content

Your first apply

With an agent connected and tagged, you can declare some state and apply it. This page uses a tiny module so you can see the whole loop — author, plan, apply, check for drift. For the full authoring surface, see Writing state modules.

A module has a name, the configurations it supports, and an ordered list of resources. This one manages a single file:

hello.ordo.yaml
name: hello-ordo
supports:
- { platform: linux }
resources:
- id: hello-file
resource:
file-unix:
path: /etc/ordo-hello
content: "Managed by Ordo.\n"
mode: "0644"

Validate it before it leaves your workstation:

Terminal window
ordo-state validate hello.ordo.yaml

Modules live on the orchestrator. Upload hello-ordo from the web UI (Modules → Upload Module) or the management API. Once uploaded, the orchestrator refers to it by name (hello-ordo).

Preview the change against your agent’s node ID first — a plan applies nothing:

Terminal window
ordo state plan --module hello-ordo <node-id>

The plan is an accurate diff of what would change. When it looks right, apply:

Terminal window
ordo state apply --module hello-ordo <node-id>

Ask the agent to compare its current machine state against the last successful apply:

Terminal window
ordo state drift <node-id>

Edit /etc/ordo-hello on the agent by hand and run it again — the change shows up as drift, surfaced but never silently reverted. See Drift & plan mode for how Ordo tracks and reports it.

  • Writing state modules — packages, services, templates, dependencies, and change triggers
  • Secrets — deliver sensitive values without agents ever touching the secret store
  • Reference — the CLI, management API, and state-file schema