Skip to content

Inventory

An inventory file defines the machines glidesh connects to. It uses KDL format.

// Global variables — inherited by all groups and hosts
vars {
deploy-user "deploy"
ssh-key "~/.ssh/id_ed25519"
}
group "web" {
vars {
http-port 8080
}
host "web-1" "10.0.0.1" user="deploy" port=22
host "web-2" "10.0.0.2" user="deploy"
host "web-3" "web3.example.com" {
vars {
http-port 9090
}
}
}
group "db" {
host "db-1" "10.0.1.1" user="root" port=2222
host "db-2" "10.0.1.2" user="root"
}
// Ungrouped host
host "monitoring" "10.0.2.1" user="admin"

Each host node takes two positional arguments:

  1. Name — a human-readable identifier (shown in the TUI)
  2. Address — IP or hostname to connect to

Optional properties:

  • user — SSH username (default: the deploy-user variable, else root)
  • port — SSH port (default: 22)
  • plan — path to a plan file to run on this host (see Inline Plans)

Hosts can also have a vars block to define host-specific variables that override group and global vars:

host "web-1" "10.0.0.1" user="deploy" {
vars {
http-port 9090
app-env "staging"
}
}

A group node collects hosts under a name. Select that name with --target on the command line (-t web, a host name, or group:host). Groups can define their own vars block and an optional plan= attribute to link a plan file (see Inline Plans).

A jump node configures an SSH bastion (jump host) that glidesh connects through before reaching the target. Jump hosts can be set once at the top level (every host), at group level (inherited by the group’s hosts) or per-host; jump #false on a group or host reaches it directly.

jump "bastion.example.com" user="jumpuser"
group "internal" {
jump "bastion-internal.example.com" user="jumpuser" port=2222
host "app-1" "10.0.1.10" user="deploy"
host "app-2" "10.0.1.11" user="deploy"
host "app-3" "10.0.1.12" user="deploy" {
jump "bastion-us.example.com"
}
}
host "edge" "203.0.113.10" user="deploy" {
jump #false
}

Optional properties on jump:

  • user — SSH username for the bastion (defaults to the target host’s user)
  • port — SSH port on the bastion (default: 22)

Resolution order: a host-level jump overrides the group-level jump, which overrides the top-level one; jump #false on a group or host means no bastion for it (at the top level it is an error). If no user is set on the jump node, it inherits the resolved user of the target host. See Jump Hosts.

A top-level run-as "<user>" node sets the default escalation for every host; group and host accept run-as="<user>" and run-as-method="sudo|doas|su" attributes. See Privilege Escalation for how these combine with plan-level settings.

Instead of passing --plan on the CLI, you can link a plan file directly to a group or host using the plan= attribute. When you run glidesh run -i inventory.kdl without --plan, glidesh automatically runs each linked plan against its associated hosts.

group "web" plan="plans/web.kdl" {
host "web-1" "10.0.0.1" user="deploy"
host "web-2" "10.0.0.2" user="deploy"
}
group "db" plan="plans/db.kdl" {
host "db-1" "10.0.1.1" user="root"
}
// Ungrouped hosts can also have a plan
host "monitoring" "10.0.2.1" user="admin" plan="plans/monitoring.kdl"

This lets different groups run different plans in a single invocation — useful when your infrastructure has distinct roles that each need their own configuration.

Variables are defined in vars blocks and follow a scoping hierarchy:

Global vars → Group vars → Host vars

The most specific value wins. Variables can be referenced in plans using ${var-name} syntax.

Variable Description
ssh-key Path to the SSH private key. Used when --key is not provided on the CLI, and then the SSH agent is not. Supports ~ expansion.
deploy-user SSH username for hosts without a user= of their own. Defaults to root.
vars {
ssh-key "~/.ssh/deploy_ed25519"
}

See CLI Reference — SSH Key Resolution for the full resolution order.

See Variables for full details on variable interpolation and merge order.

Template files can reference any host in the inventory using ${@inventory.<host>.*} syntax:

reverse_proxy ${@inventory.bifrost.address}:${@inventory.bifrost.port}

Available fields: address, user, port, and vars.<key> for the host’s resolved variables (after global → group → host vars merge).

Template files can also loop over all hosts in a group using ${for h in @group.<name>}:

${for h in @group.backend}
server ${h.address}:8080;
${endfor}

Each host exposes name, address, user, and port fields in the loop.

See Template Loops and Inventory References for details.