cloudinit

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MountTypeAuto     = "auto"
	MountTypeVirtiofs = "virtiofs"
)

Variables

This section is empty.

Functions

func CreateImage

func CreateImage(file string, cfg Configuration) error

CreateImage creates a fat32 image for cloud-init that has

Types

type Configuration

type Configuration struct {
	Metadata  Metadata
	Network   []Ethernet
	Users     []User
	Mounts    []Mount
	Extension Extension
}

type Ethernet

type Ethernet struct {
	Name        string       `yaml:"-"`
	Mac         MacMatch     `yaml:"match"`
	DHCP4       bool         `yaml:"dhcp4"`
	Addresses   []string     `yaml:"addresses"`
	Gateway4    string       `yaml:"gateway4,omitempty"`
	Gateway6    string       `yaml:"gateway6,omitempty"`
	Routes      []Route      `yaml:"routes,omitempty"`
	Nameservers *Nameservers `yaml:"nameservers,omitempty"`
}

type Extension

type Extension struct {
	Entrypoint  string
	Environment map[string]string
}

type MacMatch

type MacMatch string

func (MacMatch) MarshalYAML

func (n MacMatch) MarshalYAML() (interface{}, error)

func (MacMatch) String

func (n MacMatch) String() string

type Metadata

type Metadata struct {
	InstanceID string `yaml:"instance-id"`
	Hostname   string `yaml:"local-hostname"`
}

type Mount

type Mount struct {
	Source string
	Target string
	Type   MountType
}

func (Mount) MarshalYAML

func (m Mount) MarshalYAML() (interface{}, error)

type MountType

type MountType string

type Nameservers

type Nameservers struct {
	Search    []string `yaml:"search,omitempty"`
	Addresses []string `yaml:"addresses"` //required
}

type NetworkObjectType

type NetworkObjectType string

type Route

type Route struct {
	To     string `yaml:"to"`
	Via    string `yaml:"via"`
	Metric int    `yaml:"metric,omitempty"`
}

type SubnetType

type SubnetType string

type User

type User struct {
	Name string   `yaml:"name"`
	Keys []string `yaml:"ssh_authorized_keys"`
}

Jump to

Keyboard shortcuts

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