agentbootstrap

package
v0.0.0-...-6cf1bc9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2016 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeState

func InitializeState(
	adminUser names.UserTag,
	c agent.ConfigSetter,
	args InitializeStateParams,
	dialOpts mongo.DialOpts,
	newPolicy state.NewPolicyFunc,
) (_ *state.State, _ *state.Machine, resultErr error)

InitializeState should be called on the bootstrap machine's agent configuration. It uses that information to create the controller, dial the controller, and initialize it. It also generates a new password for the bootstrap machine and calls Write to save the the configuration.

The cfg values will be stored in the state's ModelConfig; the machineCfg values will be used to configure the bootstrap Machine, and its constraints will be also be used for the model-level constraints. The connection to the controller will respect the given timeout parameter.

InitializeState returns the newly initialized state and bootstrap machine. If it fails, the state may well be irredeemably compromised.

Types

type InitializeStateParams

type InitializeStateParams struct {
	instancecfg.StateInitializationParams

	// BootstrapMachineAddresses holds the bootstrap machine's addresses.
	BootstrapMachineAddresses []network.Address

	// BootstrapMachineJobs holds the jobs that the bootstrap machine
	// agent will run.
	BootstrapMachineJobs []multiwatcher.MachineJob

	// SharedSecret is the Mongo replica set shared secret (keyfile).
	SharedSecret string

	// Provider is called to obtain an EnvironProvider.
	Provider func(string) (environs.EnvironProvider, error)

	// StorageProviderRegistry is used to determine and store the
	// details of the default storage pools.
	StorageProviderRegistry storage.ProviderRegistry
}

InitializeStateParams holds parameters used for initializing the state database.

Jump to

Keyboard shortcuts

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