Documentation ¶
Index ¶
- Constants
- func Apply(cfg config.CloudConfig, env *Environment) error
- func ExtractIPsFromMetadata(contents []byte) (map[string]string, error)
- func ParseMetaData(contents string) (*config.CloudConfig, error)
- func ParseUserData(contents string) (interface{}, error)
- func PersistScriptInWorkspace(script config.Script, workspace string) (string, error)
- func PersistUnitNameInWorkspace(name string, workspace string) error
- func PrepWorkspace(workspace string) error
- func SSHImportGithubUser(system_user string, github_user string) error
- func SSHImportKeysFromURL(system_user string, url string) error
- type CloudConfigFile
- type CloudConfigUnit
- type Environment
- func (e *Environment) Apply(data string) string
- func (e *Environment) ConfigRoot() string
- func (e *Environment) DefaultEnvironmentFile() *system.EnvFile
- func (e *Environment) NetconfType() string
- func (e *Environment) Root() string
- func (e *Environment) SSHKeyName() string
- func (e *Environment) SetSSHKeyName(name string)
- func (e *Environment) Workspace() string
- type UserKey
Constants ¶
const DefaultSSHKeyName = "coreos-cloudinit"
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(cfg config.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 ExtractIPsFromMetadata ¶ added in v0.8.0
ExtractIPsFromMetaData parses a JSON blob in the OpenStack metadata service format and returns a substitution map possibly containing private_ipv4, public_ipv4, private_ipv6, and public_ipv6 addresses.
func ParseMetaData ¶ added in v0.8.0
func ParseMetaData(contents string) (*config.CloudConfig, error)
ParseMetaData parses a JSON blob in the OpenStack metadata service format, and converts it to a partially hydrated CloudConfig.
func ParseUserData ¶
func PrepWorkspace ¶
func SSHImportGithubUser ¶
func SSHImportKeysFromURL ¶
Types ¶
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() (*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
CloudConfigUnit represents a CoreOS specific configuration option that can generate associated system.Units to be created/enabled appropriately
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnvironment ¶
func NewEnvironment(root, configRoot, workspace, netconfType, sshKeyName string, substitutions map[string]string) *Environment
TODO(jonboulle): this is getting unwieldy, should be able to simplify the interface somehow
func (*Environment) Apply ¶
func (e *Environment) Apply(data string) string
Apply goes through the map of substitutions and replaces all instances of the keys with their respective values. It supports escaping substitutions with a leading '\'.
func (*Environment) ConfigRoot ¶ added in v0.8.0
func (e *Environment) ConfigRoot() string
func (*Environment) DefaultEnvironmentFile ¶ added in v0.8.8
func (e *Environment) DefaultEnvironmentFile() *system.EnvFile
func (*Environment) NetconfType ¶ added in v0.8.0
func (e *Environment) NetconfType() string
func (*Environment) Root ¶
func (e *Environment) Root() string
func (*Environment) SSHKeyName ¶
func (e *Environment) SSHKeyName() string
func (*Environment) SetSSHKeyName ¶
func (e *Environment) SetSSHKeyName(name string)
func (*Environment) Workspace ¶
func (e *Environment) Workspace() string