openstack

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2014 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "mitchellh.openstack"

The unique ID for this builder

Variables

This section is empty.

Functions

func SSHAddress

func SSHAddress(csp gophercloud.CloudServersProvider, port int) func(multistep.StateBag) (string, error)

SSHAddress returns a function that can be given to the SSH communicator for determining the SSH address based on the server AccessIPv4 setting..

func SSHConfig

func SSHConfig(username string) func(multistep.StateBag) (*ssh.ClientConfig, error)

SSHConfig returns a function that can be used for the SSH communicator config for connecting to the instance created over SSH using the generated private key.

func WaitForImage

func WaitForImage(csp gophercloud.CloudServersProvider, imageId string) error

WaitForImage waits for the given Image ID to become ready.

func WaitForState

func WaitForState(conf *StateChangeConf) (i interface{}, err error)

WaitForState watches an object and waits for it to achieve a certain state.

Types

type AccessConfig

type AccessConfig struct {
	Username  string `mapstructure:"username"`
	Password  string `mapstructure:"password"`
	ApiKey    string `mapstructure:"api_key"`
	Project   string `mapstructure:"project"`
	Provider  string `mapstructure:"provider"`
	RawRegion string `mapstructure:"region"`
	ProxyUrl  string `mapstructure:"proxy_url"`
	TenantId  string `mapstructure:"tenant_id"`
	Insecure  bool   `mapstructure:"insecure"`
}

AccessConfig is for common configuration related to openstack access

func (*AccessConfig) Auth

func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error)

Auth returns a valid Auth object for access to openstack services, or an error if the authentication couldn't be resolved.

func (*AccessConfig) Prepare

func (c *AccessConfig) Prepare(t *packer.ConfigTemplate) []error

func (*AccessConfig) Region added in v0.3.6

func (c *AccessConfig) Region() string

type Artifact

type Artifact struct {
	// ImageId of built image
	ImageId string

	// BuilderId is the unique ID for the builder that created this image
	BuilderIdValue string

	// OpenStack connection for performing API stuff.
	Conn gophercloud.CloudServersProvider
}

Artifact is an artifact implementation that contains built images.

func (*Artifact) BuilderId

func (a *Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (*Artifact) Files() []string

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) State added in v0.7.2

func (a *Artifact) State(name string) interface{}

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

func (*Builder) Cancel

func (b *Builder) Cancel()

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) ([]string, error)

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

type ImageConfig

type ImageConfig struct {
	ImageName string `mapstructure:"image_name"`
}

ImageConfig is for common configuration related to creating Images.

func (*ImageConfig) Prepare

func (c *ImageConfig) Prepare(t *packer.ConfigTemplate) []error

type RunConfig

type RunConfig struct {
	SourceImage       string   `mapstructure:"source_image"`
	Flavor            string   `mapstructure:"flavor"`
	RawSSHTimeout     string   `mapstructure:"ssh_timeout"`
	SSHUsername       string   `mapstructure:"ssh_username"`
	SSHPort           int      `mapstructure:"ssh_port"`
	OpenstackProvider string   `mapstructure:"openstack_provider"`
	UseFloatingIp     bool     `mapstructure:"use_floating_ip"`
	FloatingIpPool    string   `mapstructure:"floating_ip_pool"`
	FloatingIp        string   `mapstructure:"floating_ip"`
	SecurityGroups    []string `mapstructure:"security_groups"`
	Networks          []string `mapstructure:"networks"`
	// contains filtered or unexported fields
}

RunConfig contains configuration for running an instance from a source image and details on how to access that launched image.

func (*RunConfig) Prepare

func (c *RunConfig) Prepare(t *packer.ConfigTemplate) []error

func (*RunConfig) SSHTimeout

func (c *RunConfig) SSHTimeout() time.Duration

type StateChangeConf

type StateChangeConf struct {
	Pending   []string
	Refresh   StateRefreshFunc
	StepState multistep.StateBag
	Target    string
}

StateChangeConf is the configuration struct used for `WaitForState`.

type StateRefreshFunc

type StateRefreshFunc func() (result interface{}, state string, progress int, err error)

StateRefreshFunc is a function type used for StateChangeConf that is responsible for refreshing the item being watched for a state change.

It returns three results. `result` is any object that will be returned as the final object after waiting for state change. This allows you to return the final updated object, for example an openstack instance after refreshing it.

`state` is the latest state of that object. And `err` is any error that may have happened while refreshing the state.

func ServerStateRefreshFunc

func ServerStateRefreshFunc(csp gophercloud.CloudServersProvider, s *gophercloud.Server) StateRefreshFunc

ServerStateRefreshFunc returns a StateRefreshFunc that is used to watch an openstack server.

type StepAllocateIp added in v0.6.0

type StepAllocateIp struct {
	FloatingIpPool string
	FloatingIp     string
}

func (*StepAllocateIp) Cleanup added in v0.6.0

func (s *StepAllocateIp) Cleanup(state multistep.StateBag)

func (*StepAllocateIp) Run added in v0.6.0

type StepKeyPair

type StepKeyPair struct {
	Debug        bool
	DebugKeyPath string
	// contains filtered or unexported fields
}

func (*StepKeyPair) Cleanup

func (s *StepKeyPair) Cleanup(state multistep.StateBag)

func (*StepKeyPair) Run

type StepRunSourceServer

type StepRunSourceServer struct {
	Flavor         string
	Name           string
	SourceImage    string
	SecurityGroups []string
	Networks       []string
	// contains filtered or unexported fields
}

func (*StepRunSourceServer) Cleanup

func (s *StepRunSourceServer) Cleanup(state multistep.StateBag)

func (*StepRunSourceServer) Run

Jump to

Keyboard shortcuts

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