cloudconfig

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NonceFile is written by cloud-init as the last thing it does.
	// The file will contain the machine's nonce. The filename is
	// relative to the Juju data-dir.
	NonceFile = "nonce.txt"
)
View Source
const UserDataScript = `` /* 1515-byte string literal not displayed */

Variables

View Source
var (
	// UbuntuGroups is the set of unix groups to add the "ubuntu" user to
	// when initializing an Ubuntu system.
	UbuntuGroups = []string{"adm", "audio", "cdrom", "dialout", "dip",
		"floppy", "netdev", "plugdev", "sudo", "video"}

	// CentOSGroups is the set of unix groups to add the "ubuntu" user to
	// when initializing a CentOS system.
	CentOSGroups = []string{"adm", "systemd-journal", "wheel"}

	// OpenSUSEGroups is the set of unix groups to add the "ubuntu" user to
	// when initializing a OpenSUSE system.
	OpenSUSEGroups = []string{"users"}
)
View Source
var CloudInitCfgDir = paths.CloudInitCfgDir

CloudInitCfgDir is for testing purposes.

View Source
var MachineCloudInitDir = paths.MachineCloudInitDir

MachineCloudInitDir is for testing purposes.

Functions

func CloudConfigByVersionFunc

func CloudConfigByVersionFunc(series string) cloudConfigTranslateFunc

CloudConfigByVersionFunc returns the correct function to translate container-inherit-properties to cloud-init data based on series.

func GetMachineCloudInitData

func GetMachineCloudInitData(series string) (map[string]interface{}, error)

GetMachineCloudInitData returns a map of all cloud init data on the machine.

func SetUbuntuUser

func SetUbuntuUser(conf cloudinit.CloudConfig, authorizedKeys string)

SetUbuntuUser creates an "ubuntu" use for unix systems so the juju client can access the machine using ssh with the configuration we expect. On precise, the default cloudinit version is too old to support the users option, so instead rely on the default user being created and adding keys. It may make sense in the future to add a "juju" user instead across all distributions.

Types

type UserdataConfig

type UserdataConfig interface {
	// Configure is a convenience function that updates the cloudinit.Config
	// with appropriate configuration. It will run ConfigureBasic() and
	// ConfigureJuju()
	Configure() error

	// ConfigureBasic updates the provided cloudinit.Config with
	// basic configuration to initialise an OS image.
	ConfigureBasic() error

	// ConfigureJuju updates the provided cloudinit.Config with configuration
	// to initialise a Juju machine agent.
	ConfigureJuju() error

	// ConfigureCustomOverrides updates the provided cloudinit.Config with
	// user provided cloudinit data.  Data provided will overwrite current
	// values with three exceptions: preruncmd was handled in ConfigureBasic()
	// and packages and postruncmd were handled in ConfigureJuju().
	ConfigureCustomOverrides() error
}

UserdataConfig is the bridge between instancecfg and cloudinit It supports different levels of configuration for instances

func NewUserdataConfig

func NewUserdataConfig(icfg *instancecfg.InstanceConfig, conf cloudinit.CloudConfig) (UserdataConfig, error)

NewUserdataConfig is supposed to take in an instanceConfig as well as a cloudinit.cloudConfig and add attributes in the cloudinit structure based on the values inside instanceConfig and on the series

Directories

Path Synopsis
The cloudinit package implements a way of creating a cloud-init configuration file.
The cloudinit package implements a way of creating a cloud-init configuration file.
This package offers userdata in a gzipped format to be used by different cloud providers
This package offers userdata in a gzipped format to be used by different cloud providers
renderers
The renderers package implements a way to encode the userdata depending on the OS and the provider.
The renderers package implements a way to encode the userdata depending on the OS and the provider.

Jump to

Keyboard shortcuts

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