system

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 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 added in v0.10.4

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 added in v0.7.4

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 added in v0.8.8

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 added in v0.7.4

func WriteNetworkdConfigs(interfaces []network.InterfaceGenerator) error

Types

type EnvFile added in v0.8.8

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

type EtcHosts added in v0.10.4

type EtcHosts struct {
	config.EtcHosts
}

func (EtcHosts) File added in v0.10.4

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

type Etcd added in v0.10.4

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 added in v0.10.4

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 added in v0.11.1

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 added in v0.11.1

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 added in v0.10.4

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 added in v0.10.4

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 added in v0.10.4

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 added in v0.10.4

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 added in v0.7.5

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 added in v0.9.0

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 added in v0.9.0

func NewUnitManager(root string) UnitManager

type Update added in v0.10.4

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 added in v0.10.4

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 added in v0.10.4

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