cloudinit

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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