package coreutil

import "github.com/purpleidea/mgmt/lang/core/util"

Index

Constants

const (
	// ModuleName is the prefix given to all the functions in this module.
	ModuleName = "util"
)

Functions

func HostnameMapper

func HostnameMapper(ctx context.Context, input []types.Value) (types.Value, error)

HostnameMapper takes a map from mac address to hostname, and finds a hostname that corresponds to one of the mac addresses on this machine. If it cannot find a match, it returns the empty string. If it's ambiguous, it errors. This is useful for bootstrapping the hostname setup on hosts.

XXX: This should produce new values if the list of interfaces change.

Source Files

hostname_mapper.go util.go

Version
v0.0.0-20250322185616-c50a578426f1 (latest)
Published
Mar 22, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
4 days ago

Tools for package owners.