Documentation
¶
Overview ¶
Package facts implements Ansible's `setup` module / gather_facts: probing a target for a portable subset of system facts (Ansible's own ansible_facts namespace) using only POSIX shell commands present on virtually every real target, no Python required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Gather ¶
func Gather(ctx context.Context, conn remoteexec.Connection) (map[string]any, error)
Gather collects facts with real's defaults.
func GatherWith ¶ added in v0.13.0
func GatherWith(ctx context.Context, conn remoteexec.Connection, opts Options) (map[string]any, error)
GatherWith collects facts, honouring the setup module's arguments.
Types ¶
type Options ¶ added in v0.13.0
type Options struct {
// FactPath is real's fact_path: the directory of *.fact files
// exposed as ansible_local. Empty means real's own default.
FactPath string
}
Gather probes conn for a portable subset of Ansible's ansible_facts: system/kernel/architecture (uname), hostname/fqdn, distribution/ distribution_version/os_family (parsed /etc/os-release on Linux, sw_vers on macOS), date_time.epoch, processor_count, user_id, and pkg_mgr (the package manager available, for module dispatch).
The returned map's keys are bare (e.g. "system", not "ansible_system") — see vars.InjectFacts for the ansible_facts / ansible_<name> namespacing a caller applies on top. Options are the setup module's own knobs, as far as this port implements them.