system

package
v0.1.1-0...-97758b3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2014 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIpv4Address = "127.0.0.1"

Variables

This section is empty.

Functions

func AuthorizeSSHKeys

func AuthorizeSSHKeys(user string, keysName string, keys []string) error

Add the provide SSH public key to the core user's list of authorized keys

func CreateUser

func CreateUser(u *config.User) error

func DefaultReadConfig

func DefaultReadConfig() (io.Reader, error)

func EnsureDirectoryExists

func EnsureDirectoryExists(dir string) error

func ExecuteScript

func ExecuteScript(scriptPath string) (string, error)

func Hostname

func Hostname() (string, error)

func MachineID

func MachineID(root string) string

func RestartNetwork

func RestartNetwork(interfaces []network.InterfaceGenerator) (err error)

func SetHostname

func SetHostname(hostname string) error

func SetUserPassword

func SetUserPassword(user, hash string) error

func UserExists

func UserExists(u *config.User) bool

func WriteEnvFile

func WriteEnvFile(ef *EnvFile, root string) error

WriteEnvFile updates an existing env `KEY=value` formated file with new values provided in EnvFile.Vars; File.Content is ignored. Existing ordering and any unknown formatting such as comments are preserved. If no changes are required the file is untouched.

func WriteFile

func WriteFile(f *File, root string) (string, error)

func WriteNetworkdConfigs

func WriteNetworkdConfigs(interfaces []network.InterfaceGenerator) error

Types

type EnvFile

type EnvFile struct {
	Vars map[string]string
	// mask File.Content, it shouldn't be used.
	Content interface{} `json:"-" yaml:"-"`
	*File
}

type EtcHosts

type EtcHosts struct {
	config.EtcHosts
}

func (EtcHosts) File

func (eh EtcHosts) File() (*File, error)

type Etcd

type Etcd struct {
	config.Etcd
}

Etcd is a top-level structure which embeds its underlying configuration, config.Etcd, and provides the system-specific Unit().

func (Etcd) Units

func (ee Etcd) Units() []Unit

Units creates a Unit file drop-in for etcd, using any configured options.

type File

type File struct {
	config.File
}

File is a top-level structure which embeds its underlying configuration, config.File, and provides the system-specific Permissions().

func (*File) Permissions

func (f *File) Permissions() (os.FileMode, error)

type Flannel

type Flannel struct {
	config.Flannel
}

flannel is a top-level structure which embeds its underlying configuration, config.Flannel, and provides the system-specific Unit().

func (Flannel) Units

func (fl Flannel) Units() []Unit

Units generates a Unit file drop-in for flannel, if any flannel options were configured in cloud-config

type Fleet

type Fleet struct {
	config.Fleet
}

Fleet is a top-level structure which embeds its underlying configuration, config.Fleet, and provides the system-specific Unit().

func (Fleet) Units

func (fe Fleet) Units() []Unit

Units generates a Unit file drop-in for fleet, if any fleet options were configured in cloud-config

type OEM

type OEM struct {
	config.OEM
}

OEM is a top-level structure which embeds its underlying configuration, config.OEM, and provides the system-specific File().

func (OEM) File

func (oem OEM) File() (*File, error)

type Unit

type Unit struct {
	config.Unit
}

Unit is a top-level structure which embeds its underlying configuration, config.Unit, and provides the system-specific Destination().

func (*Unit) Destination

func (u *Unit) Destination(root string) string

Destination builds the appropriate absolute file path for the Unit. The root argument indicates the effective base directory of the system (similar to a chroot).

type UnitManager

type UnitManager interface {
	PlaceUnit(unit *Unit, dst string) error
	EnableUnitFile(unit string, runtime bool) error
	RunUnitCommand(command, unit string) (string, error)
	DaemonReload() error
	MaskUnit(unit *Unit) error
	UnmaskUnit(unit *Unit) error
}

func NewUnitManager

func NewUnitManager(root string) UnitManager

type Update

type Update struct {
	ReadConfig func() (io.Reader, error)
	config.Update
}

Update is a top-level structure which contains its underlying configuration, config.Update, a function for reading the configuration (the default implementation reading from the filesystem), and provides the system-specific File() and Unit().

func (Update) File

func (uc Update) File() (*File, error)

File generates an `/etc/coreos/update.conf` file (if any update configuration options are set in cloud-config) by either rewriting the existing file on disk, or starting from `/usr/share/coreos/update.conf`

func (Update) Units

func (uc Update) Units() []Unit

Units generates units for the cloud-init initializer to act on: - a locksmith Unit, if "reboot-strategy" was set in cloud-config - an update_engine Unit, if "group" or "server" was set in cloud-config

Jump to

Keyboard shortcuts

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