provision

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 38 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigOverride string

ConfigOverride is the explicit global CLI --config path.

Functions

func AddConfigSource added in v0.26.0

func AddConfigSource(location, name, ref string) error

AddConfigSource detects role/playbook roots, refusing duplicate names.

func CheckInstalledAnsibleCore added in v0.27.0

func CheckInstalledAnsibleCore() error

CheckInstalledAnsibleCore verifies the executable the CLI will find on PATH.

func ConfigLocation added in v0.26.0

func ConfigLocation() (string, string)

ConfigLocation reports the effective path and its precedence origin.

func ConfigSources added in v0.26.0

func ConfigSources() (roleSources []ConfiguredSource, playbookSources []ConfiguredSource, err error)

ConfigSources returns role sources and playbook-only sources in their configured precedence order.

func ConfigureTartInstanceHostname added in v0.27.0

func ConfigureTartInstanceHostname(vm build.VirtualMachineConfig) error

ConfigureTartInstanceHostname uses the existing guest SSH connection. Only a built-in play is used; no host role configuration is loaded.

func DefaultProvisionPlaybookPath added in v0.10.0

func DefaultProvisionPlaybookPath() string

func DiscoverHyperVAddress added in v0.27.0

func DiscoverHyperVAddress(vm alchemy_build.VirtualMachineConfig) (string, error)

DiscoverHyperVAddress returns the host-reachable address of a managed Hyper-V VM.

func DiscoverLibvirtAddress added in v0.27.0

func DiscoverLibvirtAddress(project string, vm alchemy_build.VirtualMachineConfig) (string, error)

DiscoverLibvirtAddress uses the same lease/agent discovery as provisioning.

func DiscoverTartAddress added in v0.27.0

func DiscoverTartAddress(project string, vm alchemy_build.VirtualMachineConfig) (string, error)

DiscoverTartAddress queries Tart without starting a stopped guest.

func DiscoverUTMAddress added in v0.27.0

func DiscoverUTMAddress(project string, vm alchemy_build.VirtualMachineConfig) (string, error)

DiscoverUTMAddress finds the managed guest by its configured MAC address.

func GuestCredentialSecurity added in v0.27.0

func GuestCredentialSecurity(vm alchemy_build.VirtualMachineConfig) (origin string, private bool, err error)

GuestCredentialSecurity reports only the origin and classification of the existing provisioning credentials. It uses the same environment/.env fallbacks as provisioning. It neither creates credentials nor changes a guest's password.

func PrepareSelection added in v0.26.0

func PrepareSelection(roles []string, playbook string) (string, func(), error)

PrepareSelection resolves catalog names and creates a private, disposable role playbook.

func RemoveConfigSource added in v0.26.0

func RemoveConfigSource(name string) error

func RunProvision

func RunProvision(vm alchemy_build.VirtualMachineConfig, check bool) error

func RunProvisionWithOptions added in v0.10.0

func RunProvisionWithOptions(vm alchemy_build.VirtualMachineConfig, options ProvisionOptions) error

func ValidateLocalWindowsProvisionProtocol added in v0.11.0

func ValidateLocalWindowsProvisionProtocol(protocol LocalWindowsProvisionProtocol) error

func ValidateProvisionVerbosity added in v0.10.0

func ValidateProvisionVerbosity(verbosity int) error

Types

type CatalogEntry added in v0.26.0

type CatalogEntry struct {
	Kind        string   `json:"kind"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Source      string   `json:"source"`
	Path        string   `json:"path"`
	Platforms   []string `json:"platforms"`
	Compatible  bool     `json:"compatible"`
	Shadows     []string `json:"shadows"`
}

CatalogEntry describes the first effective role or playbook with a given name.

func Catalog added in v0.26.0

func Catalog(targetOS string, refresh bool) ([]CatalogEntry, error)

Catalog reads cached Git sources without fetching unless refresh is requested. A missing checkout is cloned on first use.

type ConfiguredSource added in v0.26.0

type ConfiguredSource struct {
	Name          string
	Type          string
	Path          string
	URL           string
	Ref           string
	RolesPath     string
	PlaybooksPath string
}

ConfiguredSource is a read-only view of one configured role or playbook source.

type LocalWindowsProvisionProtocol added in v0.11.0

type LocalWindowsProvisionProtocol string
const (
	LocalWindowsProvisionProtocolWinRM LocalWindowsProvisionProtocol = "winrm"
	LocalWindowsProvisionProtocolSSH   LocalWindowsProvisionProtocol = "ssh"
)

func DefaultLocalWindowsProvisionProtocol added in v0.11.0

func DefaultLocalWindowsProvisionProtocol() LocalWindowsProvisionProtocol

type ProvisionOptions added in v0.10.0

type ProvisionOptions struct {
	Check                           bool
	AskBecomePass                   bool
	Verbosity                       int
	PlaybookPath                    string
	PlaybookPathExplicit            bool
	InventoryPath                   string
	ExtraArgs                       []string
	LocalWindowsProtocol            LocalWindowsProvisionProtocol
	LocalWindowsForceWinRMUninstall bool
	LocalWindowsForceSSHUninstall   bool
	// contains filtered or unexported fields
}

type VMIdentity added in v0.27.0

type VMIdentity struct {
	SchemaVersion int    `json:"schema_version"`
	Name          string `json:"name"`
	OS            string `json:"os"`
	Type          string `json:"type"`
	Arch          string `json:"arch"`
	Engine        string `json:"engine"`
	Exists        bool   `json:"exists"`
	InstanceID    string `json:"instance_id,omitempty"`
}

VMIdentity describes whether a target's VM exists and which instance it is. Unlike VMInfo it is available for stopped VMs.

func InspectVMIdentity added in v0.27.0

func InspectVMIdentity(vm alchemy_build.VirtualMachineConfig) (VMIdentity, error)

InspectVMIdentity reports the target's VM instance without requiring it to run.

type VMInfo added in v0.27.0

type VMInfo struct {
	SchemaVersion int    `json:"schema_version"`
	Name          string `json:"name"`
	OS            string `json:"os"`
	Type          string `json:"type"`
	Arch          string `json:"arch"`
	Engine        string `json:"engine"`
	State         string `json:"state"`
	Address       string `json:"address"`
	NetworkMode   string `json:"network_mode"`
	Protocol      string `json:"protocol"`
	Port          int    `json:"port"`
	Username      string `json:"username"`
	Password      string `json:"password"`
	// InstanceID is the hypervisor's VM identifier (libvirt/UTM UUID, Hyper-V VM Id, or Tart filesystem identity).
	// It changes when a VM is recreated under the same name; empty when the engine
	// has none sailwright reads.
	InstanceID string `json:"instance_id,omitempty"`
}

VMInfo is the versioned connection description for a running managed VM.

func InspectVM added in v0.27.0

InspectVM returns guest connection details without writing them to logs.

Jump to

Keyboard shortcuts

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