cloudinit

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CLOUD_CONFIG_HEADER      = "#cloud-config\n"
	CLOUD_SHELL_HEADER       = "#!/usr/bin/env bash\n"
	CLOUD_POWER_SHELL_HEADER = "#ps1\n"

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

	SSH_PASSWORD_AUTH_ON        = TSshPwauth("true")
	SSH_PASSWORD_AUTH_OFF       = TSshPwauth("false")
	SSH_PASSWORD_AUTH_UNCHANGED = TSshPwauth("unchanged")
)

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   TSshPwauth
}

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) RemoveUser

func (conf *SCloudConfig) RemoveUser(u SUser)

func (*SCloudConfig) UserData

func (conf *SCloudConfig) UserData() string

func (*SCloudConfig) UserDataBase64

func (conf *SCloudConfig) UserDataBase64() string

func (*SCloudConfig) UserDataEc2

func (conf *SCloudConfig) UserDataEc2() string

func (*SCloudConfig) UserDataPowerShell

func (conf *SCloudConfig) UserDataPowerShell() string

func (*SCloudConfig) UserDataScript

func (conf *SCloudConfig) UserDataScript() string

func (*SCloudConfig) UserDataScriptBase64

func (conf *SCloudConfig) UserDataScriptBase64() string

type SPhoneHome

type SPhoneHome struct {
	Url string
}

type SUser

type SUser struct {
	Name              string
	PlainTextPasswd   string
	HashedPasswd      string
	LockPasswd        bool
	SshAuthorizedKeys []string
	Sudo              string
}

func NewUser

func NewUser(name string) SUser

func (*SUser) Password

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

func (*SUser) PowerShellScripts

func (u *SUser) PowerShellScripts() []string

func (*SUser) ShellScripts

func (u *SUser) ShellScripts() []string

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

func (*SWriteFile) ShellScripts

func (wf *SWriteFile) ShellScripts() []string

type TSshPwauth

type TSshPwauth string

type TSudoPolicy

type TSudoPolicy string

Jump to

Keyboard shortcuts

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