inventory

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package inventory converts honey host records into Ansible-compatible JSON inventory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnsibleHostVars

func AnsibleHostVars(records []hosts.Record, ansibleUser, hostname string, stripPrefix bool, blacklist []string) (map[string]any, error)

AnsibleHostVars returns host variables for a single inventory hostname (dynamic inventory `--host`).

func AnsibleList

func AnsibleList(records []hosts.Record, ansibleUser string, stripPrefix bool, blacklist []string) map[string]any

AnsibleList builds the JSON object returned for `ansible-inventory` / dynamic inventory `--list`. Groups: honey (all hosts), honey_provider_<p>, honey_region_<r>, honey_zone_<z> when fields are set. Each host gets ansible_host from PrimaryIP when non-empty; connection falls back to the inventory name when empty.

func Apply added in v0.3.6

func Apply(records []hosts.Record, inv config.Inventory) error

Apply resolves inventory groups and variables into each host record.

func FilterRecords added in v0.3.6

func FilterRecords(records []hosts.Record, filters []string) ([]hosts.Record, error)

FilterRecords returns records matching all filters.

func IsFilterToken added in v0.3.6

func IsFilterToken(token string) bool

IsFilterToken reports whether token is an inventory-aware search filter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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