Documentation ¶
Index ¶
- Constants
- func SSHAddress(csp gophercloud.CloudServersProvider, port int) func(multistep.StateBag) (string, error)
- func SSHConfig(username string) func(multistep.StateBag) (*ssh.ClientConfig, error)
- func WaitForImage(csp gophercloud.CloudServersProvider, imageId string) error
- func WaitForState(conf *StateChangeConf) (i interface{}, err error)
- type AccessConfig
- type Artifact
- type Builder
- type ImageConfig
- type RunConfig
- type StateChangeConf
- type StateRefreshFunc
- type StepAllocateIp
- type StepKeyPair
- type StepRunSourceServer
Constants ¶
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 ¶
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 ¶
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.
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) SSHTimeout ¶
type StateChangeConf ¶
type StateChangeConf struct { Pending []string Refresh StateRefreshFunc StepState multistep.StateBag Target string }
StateChangeConf is the configuration struct used for `WaitForState`.
type StateRefreshFunc ¶
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
func (*StepAllocateIp) Cleanup ¶ added in v0.6.0
func (s *StepAllocateIp) Cleanup(state multistep.StateBag)
func (*StepAllocateIp) Run ¶ added in v0.6.0
func (s *StepAllocateIp) Run(state multistep.StateBag) multistep.StepAction
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 ¶
func (s *StepKeyPair) Run(state multistep.StateBag) multistep.StepAction
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 ¶
func (s *StepRunSourceServer) Run(state multistep.StateBag) multistep.StepAction