Ignition
Reference

TypeScript Types

Key exported and internal types used by Ignition.

This page mixes two scopes:

  • Types currently exported from the package root
  • Internal runtime types documented from the current source tree

Only the following types are currently importable from @grovemotorco/ignition:

import type {
  ExecutionContext,
  TemplateContext,
  Inventory,
  InventoryDefaults,
  InventoryModule,
  Host,
  HostGroup,
  ResolvedHost,
  IgnitionConfig,
} from "@grovemotorco/ignition"

Everything else below reflects the current implementation for contributors and advanced readers. Those types are not currently re-exported from the package root.

Core types

ExecutionContext

The per-host execution context passed to recipes. Carries the connection, mode, variables, and accumulated results.

FieldTypeDescription
connectionTransportSSH transport for this host
modeRunMode"apply" or "check"
errorModeErrorMode"fail-fast", "fail-at-end", or "ignore"
verbosebooleanWhether to show detailed output
hostHostContextHost connection details and name
resultsResourceResult[]Accumulated resource results
varsRecord<string, unknown>Merged variables (proxy with scope stack)
reporterReporterOutput reporter
hasFailedbooleanWhether any resource has failed
factsHostFacts | undefinedDetected platform facts
signalAbortSignal | undefinedCancellation signal
cacheCheckResultCache | undefinedCheck result cache
resourcePolicyPartial<ResourcePolicy> | undefinedTimeout and retry configuration
eventBusEventBus | undefinedEvent pipeline
resourceTagsstring[] | undefinedActive tag filter
hostCorrelationIdCorrelationId | undefinedHost correlation ID for event telemetry
redactionPolicyRedactionPolicy | undefinedRedaction policy for sensitive data

Methods:

MethodSignatureDescription
setVar(key: string, value: unknown) => voidSet a variable in the current scope
withVars<T>(overrides: Record<string, unknown>, fn: () => Promise<T>) => Promise<T>Execute with a temporary variable scope

RunMode

type RunMode = "apply" | "check"

ErrorMode

type ErrorMode = "fail-fast" | "fail-at-end" | "ignore"

Resource types

ResourceResult<TOutput>

The result of a resource execution.

FieldTypeDescription
typestringResource type (e.g. "apt", "file")
namestringDisplay name from formatName()
statusResourceStatus"ok", "changed", or "failed"
currentRecord<string, unknown> | undefinedObserved state before execution
desiredRecord<string, unknown> | undefinedTarget state from input
outputTOutput | undefinedResource-specific output data
errorError | undefinedError object if failed
durationMsnumberExecution time in milliseconds
attemptsAttemptRecord[] | undefinedRetry attempt history
cacheHitboolean | undefinedWhether the check result came from cache
cacheAgeMsnumber | undefinedAge of cached result
metaResourceCallMeta | undefinedCall metadata (tags, id)

ResourceStatus

type ResourceStatus = "ok" | "changed" | "failed"

CheckResult<TOutput>

Returned by a resource's check() method.

FieldTypeDescription
inDesiredStatebooleanWhether the resource needs changes
currentRecord<string, unknown>Observed state
desiredRecord<string, unknown>Target state
outputTOutput | undefinedSet when already in desired state

ResourceDefinition<TInput, TOutput>

The contract for implementing a resource.

FieldTypeDescription
typestringUnique lowercase identifier
schemaResourceSchema | undefinedMachine-readable schema
formatName(input: TInput) => stringHuman-readable name (pure, no I/O)
check(ctx, input) => Promise<CheckResult<TOutput>>Check phase; should avoid side effects
apply(ctx, input) => Promise<TOutput>Mutating convergence

ResourceCallMeta

Optional metadata for resource calls.

FieldTypeDescription
tagsstring[] | undefinedTags for filtering
idstring | undefinedUnique call identifier
notifystring[] | undefinedNotification labels
sensitivePathsstring[] | undefinedRedaction hints; not automatically enforced by the current CLI

ResourcePolicy

Timeout and retry configuration.

FieldTypeDefaultDescription
timeoutMsnumber30000Timeout per phase (check/apply)
retriesnumber2Retry attempts
retryDelayMsnumber1000Initial backoff
postCheckboolean | undefinedfalseVerify convergence after apply

Inventory types

Inventory

FieldTypeDescription
defaultsInventoryDefaults | undefinedConnection defaults
varsRecord<string, unknown> | undefinedGlobal variables
groupsRecord<string, HostGroup> | undefinedNamed host groups
hostsRecord<string, Host> | undefinedStandalone hosts

Host

FieldTypeDescription
hostnamestringSSH hostname or IP
userstring | undefinedSSH user
portnumber | undefinedSSH port
privateKeystring | undefinedPath to private key
varsRecord<string, unknown> | undefinedHost-specific variables

HostGroup

FieldTypeDescription
hostsRecord<string, Host>Hosts in this group
varsRecord<string, unknown> | undefinedGroup-level variables

ResolvedHost

A fully resolved host ready for connection.

FieldTypeDescription
namestringLogical name
hostnamestringSSH hostname
userstringSSH user (resolved from defaults)
portnumberSSH port (resolved from defaults)
privateKeystring | undefinedPrivate key path
varsRecord<string, unknown>Merged variables

Recipe types

RecipeFunction

type RecipeFunction = (ctx: ExecutionContext) => Promise<void>

RecipeMeta

FieldTypeDescription
descriptionstring | undefinedHuman-readable description
tagsstring[] | undefinedTags for filtering

Run summary types

RunSummary

FieldTypeDescription
hostsHostRunSummary[]Per-host results
hasFailuresbooleanWhether any host had failures
durationMsnumberTotal run duration
modeRunModeRun mode
timestampstringISO 8601 timestamp
recipe{ path: string; checksum: string } | undefinedRecipe file info

HostRunSummary

FieldTypeDescription
hostHostContextHost details
resultsResourceResult[]Resource results
oknumberCount of ok resources
changednumberCount of changed resources
failednumberCount of failed resources
durationMsnumberHost execution time
cancelledboolean | undefinedWhether the host was cancelled

Transport types

Transport

SSH transport interface.

MethodSignatureDescription
configSSHConnectionConfigConnection configuration
capabilities() => ReadonlySet<TransportCapability>Supported capabilities
exec(command, opts?) => Promise<ExecResult>Run a command
transfer(localPath, remotePath, signal?) => Promise<void>Upload a file
fetch(remotePath, localPath, signal?) => Promise<void>Download a file
ping() => Promise<boolean>Test connectivity
close() => Promise<void>Close the connection

TransportCapability

type TransportCapability = "exec" | "transfer" | "fetch" | "ping"

HostFacts

Platform detection results.

FieldTypeDescription
distroDistroFamily"debian", "rhel", "alpine", or "unknown"
distroIdstringRaw distro ID (e.g. "ubuntu")
distroVersionstringVersion string (e.g. "22.04")
pkgManagerPackageManager"apt", "dnf", "yum", "apk", or null
initSystemInitSystem"systemd", "openrc", or null
archstringArchitecture (e.g. "x86_64", "aarch64")

TemplateContext

type TemplateContext = Record<string, unknown>

On this page