provision

package
v0.1.55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package provision is the host-side, pull-based OS reconciler. It is run by a small root systemd service (ruust-provision.service) on a timer, separately from the unprivileged main agent loop, and converges the privileged host substrate the agent itself cannot change: the egg-egress firewall, required OS packages, and the agent unit's network capabilities.

Like everything else in Ruust it is pull-based: the host fetches a versioned provisioning manifest from the control plane (which never dials the host) and makes the box match. A generation hash means an unchanged manifest is a cheap no-op, so the timer can run often without churn. This is what lets a firewall or fair-use change land on every host with no re-enrol.

The actual OS mutation is Linux-only (iptables, apt, systemd); on other platforms Apply is a no-op so the agent still builds and vets on a developer's machine.

British English throughout. No em dashes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

Apply converges the host to the manifest. Each step is independent and idempotent; errors are collected so a failure in one does not block the others, and the caller only records the generation (stopping retries) when everything succeeded.

func ReportedSSHState added in v0.1.49

func ReportedSSHState() (passwordAuthEnabled bool, operatorKeyCount int, ok bool)

ReportedSSHState reads the effective SSH state the root reconciler last wrote. ok is false when there is no fresh probe (no reconciler installed, not run recently, or the file is unreadable/corrupt), which the caller reports as reconcilerActive=false. Pure file read, so it works on any platform (the main agent loop calls it).

func Run

func Run(ctx context.Context, o Options) error

Run fetches the provisioning manifest and, when it differs from what this host last applied, converges the host to match. It is safe to run on a timer: an unchanged manifest returns quickly without touching the system.

Types

type Options

type Options struct {
	ControlPlaneURL string
	HostID          string
	Token           string
	AgentVersion    string
	HTTP            *http.Client
	Log             *slog.Logger
}

Options are the inputs the provision reconciler needs. They mirror the main agent's configuration, resolved from the same environment and token file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL