Documentation
¶
Overview ¶
Package inventory converts honey host records into Ansible-compatible JSON inventory.
Index ¶
- func AnsibleHostVars(records []hosts.Record, ansibleUser, hostname string, stripPrefix bool, ...) (map[string]any, error)
- func AnsibleList(records []hosts.Record, ansibleUser string, stripPrefix bool, ...) map[string]any
- func Apply(records []hosts.Record, inv config.Inventory) error
- func FilterRecords(records []hosts.Record, filters []string) ([]hosts.Record, error)
- func IsFilterToken(token string) bool
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 FilterRecords ¶ added in v0.3.6
FilterRecords returns records matching all filters.
func IsFilterToken ¶ added in v0.3.6
IsFilterToken reports whether token is an inventory-aware search filter.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.