Documentation ¶
Index ¶
- Constants
- func CreateDefaultCloudInitNetworkData() string
- func CreateNetworkDataWithStaticIPsByIface(ifaceName, ipAddress string) string
- func CreateNetworkDataWithStaticIPsByMac(ifaceName, macAddress, ipAddress string) string
- func GetFedoraToolsGuestAgentBlacklistUserData(commands string) string
- func NewNetworkData(options ...NetworkDataOption) (string, error)
- type CloudInitInterface
- type CloudInitMatch
- type CloudInitNameservers
- type CloudInitNetworkData
- type CloudInitRoute
- type NetworkDataInterfaceOption
- func WithAcceptRA() NetworkDataInterfaceOption
- func WithAddresses(addresses ...string) NetworkDataInterfaceOption
- func WithDHCP4Enabled() NetworkDataInterfaceOption
- func WithDHCP6Enabled() NetworkDataInterfaceOption
- func WithGateway6(gateway6 string) NetworkDataInterfaceOption
- func WithMatchingMAC(macAddress string) NetworkDataInterfaceOption
- func WithNameserverFromCluster() NetworkDataInterfaceOption
- type NetworkDataOption
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 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 CloudInitNameservers ¶
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
Click to show internal directories.
Click to hide internal directories.