cloudinit

package
v2.3.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Index

Constants

View Source
const (
	CLOUD_CONFIG_HEADER = "#cloud-config\n"

	USER_SUDO_NOPASSWD = TSudoPolicy("sudo_nopasswd")
	USER_SUDO          = TSudoPolicy("sudo")
	USER_SUDO_DENY     = TSudoPolicy("sudo_deny")
	USER_SUDO_NONE     = TSudoPolicy("")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SCloudConfig

type SCloudConfig struct {
	Users       []SUser
	WriteFiles  []SWriteFile
	Runcmd      []string
	Bootcmd     []string
	Packages    []string
	PhoneHome   *SPhoneHome
	DisableRoot int
	SshPwauth   int
}

func ParseUserData

func ParseUserData(data string) (*SCloudConfig, error)

func ParseUserDataBase64

func ParseUserDataBase64(b64data string) (*SCloudConfig, error)

func (*SCloudConfig) Merge

func (conf *SCloudConfig) Merge(conf2 *SCloudConfig)

func (*SCloudConfig) MergeBootcmd

func (conf *SCloudConfig) MergeBootcmd(cmd string)

func (*SCloudConfig) MergePackage

func (conf *SCloudConfig) MergePackage(pkg string)

func (*SCloudConfig) MergeRuncmd

func (conf *SCloudConfig) MergeRuncmd(cmd string)

func (*SCloudConfig) MergeUser

func (conf *SCloudConfig) MergeUser(u SUser)

func (*SCloudConfig) MergeWriteFile

func (conf *SCloudConfig) MergeWriteFile(f SWriteFile, replace bool)

func (*SCloudConfig) UserData

func (conf *SCloudConfig) UserData() string

func (*SCloudConfig) UserDataBase64

func (conf *SCloudConfig) UserDataBase64() string

type SPhoneHome

type SPhoneHome struct {
	Url string
}

type SUser

type SUser struct {
	Name              string
	Passwd            string
	LockPassword      string
	SshAuthorizedKeys []string
	Sudo              string
}

func NewUser

func NewUser(name string) SUser

func (*SUser) Password

func (u *SUser) Password(passwd string) *SUser

func (*SUser) SshKey

func (u *SUser) SshKey(key string) *SUser

func (*SUser) SudoPolicy

func (u *SUser) SudoPolicy(policy TSudoPolicy) *SUser

type SWriteFile

type SWriteFile struct {
	Path        string
	Permissions string
	Owner       string
	Encoding    string
	Content     string
}

func NewWriteFile

func NewWriteFile(path string, content string, perm string, owner string, isBase64 bool) SWriteFile

type TSudoPolicy

type TSudoPolicy string

Jump to

Keyboard shortcuts

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