cloudinit

package
v1.3.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultIPv6Address = "fd10:0:2::2"
	DefaultIPv6CIDR    = DefaultIPv6Address + "/120"
	DefaultIPv6Gateway = "fd10:0:2::1"
)

Variables

This section is empty.

Functions

func CreateDefaultCloudInitNetworkData

func CreateDefaultCloudInitNetworkData() string

CreateDefaultCloudInitNetworkData generates a default configuration for the Cloud-Init Network Data, in version 2 format. The default configuration sets dynamic IPv4 (DHCP) and static IPv6 addresses, inclusing DNS settings of the cluster nameserver IP and search domains.

func CreateNetworkDataWithStaticIPsByIface

func CreateNetworkDataWithStaticIPsByIface(ifaceName, ipAddress string) string

func CreateNetworkDataWithStaticIPsByMac

func CreateNetworkDataWithStaticIPsByMac(ifaceName, macAddress, ipAddress string) string

func GetFedoraToolsGuestAgentBlacklistUserData

func GetFedoraToolsGuestAgentBlacklistUserData(commands string) string

func NewNetworkData

func NewNetworkData(options ...NetworkDataOption) (string, error)

Types

type CloudInitInterface

type CloudInitInterface struct {
	AcceptRA       *bool                `json:"accept-ra,omitempty"`
	Addresses      []string             `json:"addresses,omitempty"`
	DHCP4          *bool                `json:"dhcp4,omitempty"`
	DHCP6          *bool                `json:"dhcp6,omitempty"`
	DHCPIdentifier string               `json:"dhcp-identifier,omitempty"` // "duid" or  "mac"
	Gateway4       string               `json:"gateway4,omitempty"`
	Gateway6       string               `json:"gateway6,omitempty"`
	Nameservers    CloudInitNameservers `json:"nameservers,omitempty"`
	MACAddress     string               `json:"macaddress,omitempty"`
	Match          CloudInitMatch       `json:"match,omitempty"`
	MTU            int                  `json:"mtu,omitempty"`
	Routes         []CloudInitRoute     `json:"routes,omitempty"`
	SetName        string               `json:"set-name,omitempty"`
	// contains filtered or unexported fields
}

type CloudInitMatch

type CloudInitMatch struct {
	Name       string `json:"name,omitempty"`
	MACAddress string `json:"macaddress,omitempty"`
	Driver     string `json:"driver,omitempty"`
}

type CloudInitNameservers

type CloudInitNameservers struct {
	Search    []string `json:"search,omitempty"`
	Addresses []string `json:"addresses,omitempty"`
}

type CloudInitNetworkData

type CloudInitNetworkData struct {
	Version   int                           `json:"version"`
	Ethernets map[string]CloudInitInterface `json:"ethernets,omitempty"`
}

type CloudInitRoute

type CloudInitRoute struct {
	From   string `json:"from,omitempty"`
	OnLink *bool  `json:"on-link,omitempty"`
	Scope  string `json:"scope,omitempty"`
	Table  *int   `json:"table,omitempty"`
	To     string `json:"to,omitempty"`
	Type   string `json:"type,omitempty"`
	Via    string `json:"via,omitempty"`
	Metric *int   `json:"metric,omitempty"`
}

type NetworkDataInterfaceOption

type NetworkDataInterfaceOption func(*CloudInitInterface) error

func WithAcceptRA

func WithAcceptRA() NetworkDataInterfaceOption

func WithAddresses

func WithAddresses(addresses ...string) NetworkDataInterfaceOption

func WithDHCP4Enabled

func WithDHCP4Enabled() NetworkDataInterfaceOption

func WithDHCP6Enabled

func WithDHCP6Enabled() NetworkDataInterfaceOption

func WithGateway6

func WithGateway6(gateway6 string) NetworkDataInterfaceOption

func WithMatchingMAC

func WithMatchingMAC(macAddress string) NetworkDataInterfaceOption

func WithNameserverFromCluster

func WithNameserverFromCluster() NetworkDataInterfaceOption

type NetworkDataOption

type NetworkDataOption func(*CloudInitNetworkData) error

func WithEthernet

func WithEthernet(name string, options ...NetworkDataInterfaceOption) NetworkDataOption

Jump to

Keyboard shortcuts

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