cloudinit

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenImage

func GenImage(data *Data, outfile string) error

Types

type Data

type Data struct {
	Meta    MetadataConfig
	Network NetworkConfig

	// These fields override the same name keys from User structure
	Hostname string
	Domain   string
	Timezone string

	User map[string]interface{}
}

type EthernetConfig

type EthernetConfig struct {
	Match struct {
		MacAddress string `json:"macaddress" yaml:"macaddress"`
	} `json:"match" yaml:"match"`
	Addresses []string `json:"addresses" yaml:"addresses"`
	Gateway4  string   `json:"gateway4,omitempty" yaml:"gateway4,omitempty"`
	Gateway6  string   `json:"gateway6,omitempty" yaml:"gateway6,omitempty"`
}

func (EthernetConfig) MarshalYAML added in v1.4.1

func (c EthernetConfig) MarshalYAML() (interface{}, error)

Function is used to provide backward compatibility with Phoenix Guest Agent, which looks at the "mac_address" field.

type MetadataConfig

type MetadataConfig struct {
	DSMode     string `json:"dsmode" yaml:"dsmode"`
	InstanceID string `json:"instance-id" yaml:"instance-id"`

	LocalHostname    string `json:"local-hostname,omitempty" yaml:"local-hostname,omitempty"`
	Platform         string `json:"platform,omitempty" yaml:"platform,omitempty"`
	Subplatform      string `json:"subplatform,omitempty" yaml:"subplatform,omitempty"`
	Cloudname        string `json:"cloud-name,omitempty" yaml:"cloud-name,omitempty"`
	Region           string `json:"region,omitempty" yaml:"region,omitempty"`
	AvailabilityZone string `json:"availability-zone,omitempty" yaml:"availability-zone,omitempty"`
}

type NetworkConfig

type NetworkConfig struct {
	Version   int                       `json:"version" yaml:"version"`
	Ethernets map[string]EthernetConfig `json:"ethernets" yaml:"ethernets"`
}

Jump to

Keyboard shortcuts

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