cloudinit

package
v0.0.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(isoPath, label string, layout []Entry) error

Types

type Config

type Config struct {
	VendorData   VendorData
	MetaData     MetaData
	UserDataPath string
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(logger hclog.Logger) (*Controller, error)

func (*Controller) Apply

func (c *Controller) Apply(ci *Config, ciPath string) error

Apply takes the cloud init configuration and writes it into an iso (ISO-9660) disk. In order for cloud init to pick it up, the meta-data, user-data and vendor-data files need to be in the root of the disk, and it needs to be labeled with "cidata".

type Entry

type Entry struct {
	Path   string
	Reader io.Reader
}

type File

type File struct {
	Path        string
	Content     string
	Permissions string
	Encoding    string
	Owner       string
	Group       string
}

type MetaData

type MetaData struct {
	InstanceID    string
	LocalHostname string
}

type MountFileConfig

type MountFileConfig struct {
	Destination string
	Tag         string
}

type VendorData

type VendorData struct {
	// The password and SSHKeys will be added to the default user of the cloud image
	// distribution.
	Password string
	SSHKey   string
	// RunCMD will be run inside the VM once it has started.
	RunCMD []string
	// BootCMD will be run inside the VM at booting time.
	BootCMD []string
	Mounts  []MountFileConfig
	Files   []File
}

Jump to

Keyboard shortcuts

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