initialize

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIpv4Address = "127.0.0.1"
View Source
const DefaultSSHKeyName = "coreos-cloudinit"

Variables

This section is empty.

Functions

func Apply

func Apply(cfg CloudConfig, env *Environment) error

Apply renders a CloudConfig to an Environment. This can involve things like configuring the hostname, adding new users, writing various configuration files to disk, and manipulating systemd services.

func ParseUserData

func ParseUserData(contents string) (interface{}, error)

func PersistScriptInWorkspace

func PersistScriptInWorkspace(script system.Script, workspace string) (string, error)

func PersistUnitNameInWorkspace

func PersistUnitNameInWorkspace(name string, workspace string) error

func PrepWorkspace

func PrepWorkspace(workspace string) error

func SSHImportGithubUser

func SSHImportGithubUser(system_user string, github_user string) error

func SSHImportKeysFromURL

func SSHImportKeysFromURL(system_user string, url string) error

Types

type CloudConfig

type CloudConfig struct {
	SSHAuthorizedKeys []string `yaml:"ssh_authorized_keys"`
	Coreos            struct {
		Etcd   EtcdEnvironment
		Fleet  FleetEnvironment
		OEM    OEMRelease
		Update UpdateConfig
		Units  []system.Unit
	}
	WriteFiles     []system.File `yaml:"write_files"`
	Hostname       string
	Users          []system.User
	ManageEtcHosts EtcHosts `yaml:"manage_etc_hosts"`
}

CloudConfig encapsulates the entire cloud-config configuration file and maps directly to YAML

func NewCloudConfig

func NewCloudConfig(contents string) (*CloudConfig, error)

NewCloudConfig instantiates a new CloudConfig from the given contents (a string of YAML), returning any error encountered. It will ignore unknown fields but log encountering them.

func (CloudConfig) String

func (cc CloudConfig) String() string

type CloudConfigFile added in v0.7.0

type CloudConfigFile interface {
	// File should either return (*system.File, error), or (nil, nil) if nothing
	// needs to be done for this configuration option.
	File(root string) (*system.File, error)
}

CloudConfigFile represents a CoreOS specific configuration option that can generate an associated system.File to be written to disk

type CloudConfigUnit added in v0.7.0

type CloudConfigUnit interface {
	// Unit should either return (*system.Unit, error), or (nil, nil) if nothing
	// needs to be done for this configuration option.
	Unit(root string) (*system.Unit, error)
}

CloudConfigUnit represents a CoreOS specific configuration option that can generate an associated system.Unit to be created/enabled appropriately

type Environment

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

func NewEnvironment

func NewEnvironment(root, workspace string) *Environment

func (*Environment) Apply

func (self *Environment) Apply(data string) string

func (*Environment) Root

func (self *Environment) Root() string

func (*Environment) SSHKeyName

func (self *Environment) SSHKeyName() string

func (*Environment) SetSSHKeyName

func (self *Environment) SetSSHKeyName(name string)

func (*Environment) Workspace

func (self *Environment) Workspace() string

type EtcHosts added in v0.7.0

type EtcHosts string

func (EtcHosts) File added in v0.7.0

func (eh EtcHosts) File(root string) (*system.File, error)

type EtcdEnvironment

type EtcdEnvironment map[string]string

func (EtcdEnvironment) String

func (ee EtcdEnvironment) String() (out string)

func (EtcdEnvironment) Unit added in v0.7.0

func (ee EtcdEnvironment) Unit(root string) (*system.Unit, error)

Unit creates a Unit file drop-in for etcd, using any configured options and adding a default MachineID if unset.

type FleetEnvironment added in v0.7.0

type FleetEnvironment map[string]string

func (FleetEnvironment) String added in v0.7.0

func (fe FleetEnvironment) String() (out string)

func (FleetEnvironment) Unit added in v0.7.0

func (fe FleetEnvironment) Unit(root string) (*system.Unit, error)

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

type OEMRelease

type OEMRelease struct {
	ID           string `yaml:"id"`
	Name         string `yaml:"name"`
	VersionID    string `yaml:"version-id"`
	HomeURL      string `yaml:"home-url"`
	BugReportURL string `yaml:"bug-report-url"`
}

func (OEMRelease) File added in v0.7.0

func (oem OEMRelease) File(root string) (*system.File, error)

func (OEMRelease) String

func (oem OEMRelease) String() string

type UpdateConfig added in v0.7.0

type UpdateConfig map[string]string

func (UpdateConfig) File added in v0.7.0

func (uc UpdateConfig) File(root string) (*system.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 (UpdateConfig) Unit added in v0.7.0

func (uc UpdateConfig) Unit(root string) (*system.Unit, error)

GetUnit generates a locksmith system.Unit, if reboot-strategy was set in cloud-config, for the cloud-init initializer to act on appropriately

type UserKey

type UserKey struct {
	ID  int    `json:"id,omitempty"`
	Key string `json:"key"`
}

Jump to

Keyboard shortcuts

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