cloudinitfile

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Useful for 1 allowing the user to update the cloud-init file without restarting the serer. Also validates a users cloud-init data and has helpers for managing milpa data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudConfig added in v0.0.6

type CloudConfig struct {
	SSHAuthorizedKeys []string        `yaml:"ssh_authorized_keys,omitempty"`
	WriteFiles        []CloudInitFile `yaml:"write_files,omitempty"`
	Hostname          string          `yaml:"hostname,omitempty"`
	Users             []User          `yaml:"users,omitempty"`
	RunCmd            []string        `yaml:"runcmd,omitempty"`
	// this one is legacy, can be removed when no more kip controllers use it
	MilpaFiles []CloudInitFile `yaml:"milpa_files,omitempty"`
}

CloudConfig encapsulates the entire cloud-config configuration file and maps directly to YAML. Fields that cannot be set in the cloud-config (fields used for internal use) have the YAML tag '-' so that they aren't marshalled.

type CloudInitFile added in v0.0.6

type CloudInitFile struct {
	Encoding           string `yaml:"encoding,omitempty" valid:"^(base64|b64|gz|gzip|gz\\+base64|gzip\\+base64|gz\\+b64|gzip\\+b64)$"`
	Content            string `yaml:"content,omitempty"`
	Owner              string `yaml:"owner,omitempty"`
	Path               string `yaml:"path,omitempty"`
	RawFilePermissions string `yaml:"permissions,omitempty" valid:"^0?[0-7]{3,4}$"`
}

type File

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

func New

func New(path string) (*File, error)

func (*File) AddKipFile

func (f *File) AddKipFile(content, path, permissions string)

func (*File) Contents

func (f *File) Contents() ([]byte, error)

func (*File) ResetInstanceData

func (f *File) ResetInstanceData()

type User added in v0.0.6

type User struct {
	Name                 string   `yaml:"name,omitempty"`
	PasswordHash         string   `yaml:"passwd,omitempty"`
	SSHAuthorizedKeys    []string `yaml:"ssh_authorized_keys,omitempty"`
	SSHImportGithubUser  string   `` /* 139-byte string literal not displayed */
	SSHImportGithubUsers []string `` /* 139-byte string literal not displayed */
	SSHImportURL         string   `` /* 139-byte string literal not displayed */
	GECOS                string   `yaml:"gecos,omitempty"`
	Homedir              string   `yaml:"homedir,omitempty"`
	NoCreateHome         bool     `yaml:"no_create_home,omitempty"`
	PrimaryGroup         string   `yaml:"primary_group,omitempty"`
	Groups               []string `yaml:"groups,omitempty"`
	NoUserGroup          bool     `yaml:"no_user_group,omitempty"`
	System               bool     `yaml:"system,omitempty"`
	NoLogInit            bool     `yaml:"no_log_init,omitempty"`
	Shell                string   `yaml:"shell,omitempty"`
}

Jump to

Keyboard shortcuts

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