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.
The per-host execution context passed to recipes. Carries the connection, mode, variables, and accumulated results.
Field Type Description 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:
Method Signature Description 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
type RunMode = " apply " | " check "
type ErrorMode = " fail-fast " | " fail-at-end " | " ignore "
The result of a resource execution.
Field Type Description 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)
type ResourceStatus = " ok " | " changed " | " failed "
Returned by a resource's check() method.
Field Type Description inDesiredStatebooleanWhether the resource needs changes currentRecord<string, unknown>Observed state desiredRecord<string, unknown>Target state outputTOutput | undefinedSet when already in desired state
The contract for implementing a resource.
Field Type Description 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
Optional metadata for resource calls.
Field Type Description tagsstring[] | undefinedTags for filtering idstring | undefinedUnique call identifier notifystring[] | undefinedNotification labels sensitivePathsstring[] | undefinedRedaction hints; not automatically enforced by the current CLI
Timeout and retry configuration.
Field Type Default Description timeoutMsnumber30000Timeout per phase (check/apply) retriesnumber2Retry attempts retryDelayMsnumber1000Initial backoff postCheckboolean | undefinedfalseVerify convergence after apply
Field Type Description defaultsInventoryDefaults | undefinedConnection defaults varsRecord<string, unknown> | undefinedGlobal variables groupsRecord<string, HostGroup> | undefinedNamed host groups hostsRecord<string, Host> | undefinedStandalone hosts
Field Type Description hostnamestringSSH hostname or IP userstring | undefinedSSH user portnumber | undefinedSSH port privateKeystring | undefinedPath to private key varsRecord<string, unknown> | undefinedHost-specific variables
Field Type Description hostsRecord<string, Host>Hosts in this group varsRecord<string, unknown> | undefinedGroup-level variables
A fully resolved host ready for connection.
Field Type Description namestringLogical name hostnamestringSSH hostname userstringSSH user (resolved from defaults) portnumberSSH port (resolved from defaults) privateKeystring | undefinedPrivate key path varsRecord<string, unknown>Merged variables
type RecipeFunction = ( ctx : ExecutionContext ) => Promise<void>
Field Type Description descriptionstring | undefinedHuman-readable description tagsstring[] | undefinedTags for filtering
Field Type Description 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
Field Type Description 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
SSH transport interface.
Method Signature Description 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
type TransportCapability = " exec " | " transfer " | " fetch " | " ping "
Platform detection results.
Field Type Description distroDistroFamily"debian", "rhel", "alpine", or "unknown"distroIdstringRaw distro ID (e.g. "ubuntu") distroVersionstringVersion string (e.g. "22.04") pkgManagerPackageManager"apt", "dnf", "yum", "apk", or nullinitSystemInitSystem"systemd", "openrc", or nullarchstringArchitecture (e.g. "x86_64", "aarch64")
type TemplateContext = Record<string , unknown>