Documentation ¶
Index ¶
- Constants
- func CommHost(client *gophercloud.ServiceClient, sshinterface string, sshipversion string) func(multistep.StateBag) (string, error)
- func SSHConfig(useAgent bool, username, password string) func(multistep.StateBag) (*ssh.ClientConfig, error)
- func WaitForImage(client *gophercloud.ServiceClient, imageId string) error
- func WaitForState(conf *StateChangeConf) (i interface{}, err error)
- type AccessConfig
- type Artifact
- type Builder
- type Config
- type ImageConfig
- type RunConfig
- type StateChangeConf
- type StateRefreshFunc
- type StepAllocateIp
- type StepGetPassword
- type StepKeyPair
- type StepLoadExtensions
- type StepLoadFlavor
- type StepRunSourceServer
- type StepStopServer
- type StepWaitForRackConnect
Constants ¶
const BuilderId = "mitchellh.openstack"
The unique ID for this builder
Variables ¶
This section is empty.
Functions ¶
func CommHost ¶
func CommHost( client *gophercloud.ServiceClient, sshinterface string, sshipversion string) func(multistep.StateBag) (string, error)
CommHost looks up the host for the communicator.
func SSHConfig ¶
func SSHConfig(useAgent bool, username, password 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 a private key or a password.
func WaitForImage ¶
func WaitForImage(client *gophercloud.ServiceClient, 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"` UserID string `mapstructure:"user_id"` Password string `mapstructure:"password"` IdentityEndpoint string `mapstructure:"identity_endpoint"` TenantID string `mapstructure:"tenant_id"` TenantName string `mapstructure:"tenant_name"` DomainID string `mapstructure:"domain_id"` DomainName string `mapstructure:"domain_name"` Insecure bool `mapstructure:"insecure"` Region string `mapstructure:"region"` EndpointType string `mapstructure:"endpoint_type"` CACertFile string `mapstructure:"cacert"` ClientCertFile string `mapstructure:"cert"` ClientKeyFile string `mapstructure:"key"` // contains filtered or unexported fields }
AccessConfig is for common configuration related to openstack access
func (*AccessConfig) Prepare ¶
func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error
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. Client *gophercloud.ServiceClient }
Artifact is an artifact implementation that contains built images.
type Config ¶
type Config struct { common.PackerConfig `mapstructure:",squash"` AccessConfig `mapstructure:",squash"` ImageConfig `mapstructure:",squash"` RunConfig `mapstructure:",squash"` // contains filtered or unexported fields }
type ImageConfig ¶
type ImageConfig struct { ImageName string `mapstructure:"image_name"` ImageMetadata map[string]string `mapstructure:"metadata"` ImageVisibility imageservice.ImageVisibility `mapstructure:"image_visibility"` ImageMembers []string `mapstructure:"image_members"` }
ImageConfig is for common configuration related to creating Images.
func (*ImageConfig) Prepare ¶
func (c *ImageConfig) Prepare(ctx *interpolate.Context) []error
type RunConfig ¶
type RunConfig struct { Comm communicator.Config `mapstructure:",squash"` SSHKeyPairName string `mapstructure:"ssh_keypair_name"` TemporaryKeyPairName string `mapstructure:"temporary_key_pair_name"` SSHInterface string `mapstructure:"ssh_interface"` SSHIPVersion string `mapstructure:"ssh_ip_version"` SourceImage string `mapstructure:"source_image"` SourceImageName string `mapstructure:"source_image_name"` Flavor string `mapstructure:"flavor"` AvailabilityZone string `mapstructure:"availability_zone"` RackconnectWait bool `mapstructure:"rackconnect_wait"` FloatingIpPool string `mapstructure:"floating_ip_pool"` FloatingIp string `mapstructure:"floating_ip"` ReuseIps bool `mapstructure:"reuse_ips"` SecurityGroups []string `mapstructure:"security_groups"` Networks []string `mapstructure:"networks"` UserData string `mapstructure:"user_data"` UserDataFile string `mapstructure:"user_data_file"` InstanceMetadata map[string]string `mapstructure:"instance_metadata"` ConfigDrive bool `mapstructure:"config_drive"` // Not really used, but here for BC OpenstackProvider string `mapstructure:"openstack_provider"` UseFloatingIp bool `mapstructure:"use_floating_ip"` }
RunConfig contains configuration for running an instance from a source image and details on how to access that launched image.
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( client *gophercloud.ServiceClient, s *servers.Server) StateRefreshFunc
ServerStateRefreshFunc returns a StateRefreshFunc that is used to watch an openstack server.
type StepAllocateIp ¶
func (*StepAllocateIp) Cleanup ¶
func (s *StepAllocateIp) Cleanup(state multistep.StateBag)
func (*StepAllocateIp) Run ¶
func (s *StepAllocateIp) Run(state multistep.StateBag) multistep.StepAction
type StepGetPassword ¶
type StepGetPassword struct { Debug bool Comm *communicator.Config }
StepGetPassword reads the password from a booted OpenStack server and sets it on the WinRM config.
func (*StepGetPassword) Cleanup ¶
func (s *StepGetPassword) Cleanup(multistep.StateBag)
func (*StepGetPassword) Run ¶
func (s *StepGetPassword) Run(state multistep.StateBag) multistep.StepAction
type StepKeyPair ¶
type StepKeyPair struct { Debug bool SSHAgentAuth bool DebugKeyPath string TemporaryKeyPairName string KeyPairName string PrivateKeyFile 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 StepLoadExtensions ¶
type StepLoadExtensions struct{}
StepLoadExtensions gets the FlavorRef from a Flavor. It first assumes that the Flavor is a ref and verifies it. Otherwise, it tries to find the flavor by name.
func (*StepLoadExtensions) Cleanup ¶
func (s *StepLoadExtensions) Cleanup(state multistep.StateBag)
func (*StepLoadExtensions) Run ¶
func (s *StepLoadExtensions) Run(state multistep.StateBag) multistep.StepAction
type StepLoadFlavor ¶
type StepLoadFlavor struct {
Flavor string
}
StepLoadFlavor gets the FlavorRef from a Flavor. It first assumes that the Flavor is a ref and verifies it. Otherwise, it tries to find the flavor by name.
func (*StepLoadFlavor) Cleanup ¶
func (s *StepLoadFlavor) Cleanup(state multistep.StateBag)
func (*StepLoadFlavor) Run ¶
func (s *StepLoadFlavor) Run(state multistep.StateBag) multistep.StepAction
type StepRunSourceServer ¶
type StepRunSourceServer struct { Name string SourceImage string SourceImageName string SecurityGroups []string Networks []string AvailabilityZone string UserData string UserDataFile string ConfigDrive bool InstanceMetadata map[string]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
type StepStopServer ¶
type StepStopServer struct{}
func (*StepStopServer) Cleanup ¶
func (s *StepStopServer) Cleanup(state multistep.StateBag)
func (*StepStopServer) Run ¶
func (s *StepStopServer) Run(state multistep.StateBag) multistep.StepAction
type StepWaitForRackConnect ¶
type StepWaitForRackConnect struct {
Wait bool
}
func (*StepWaitForRackConnect) Cleanup ¶
func (s *StepWaitForRackConnect) Cleanup(state multistep.StateBag)
func (*StepWaitForRackConnect) Run ¶
func (s *StepWaitForRackConnect) Run(state multistep.StateBag) multistep.StepAction
Source Files ¶
- access_config.go
- artifact.go
- builder.go
- image_config.go
- run_config.go
- server.go
- ssh.go
- step_add_image_members.go
- step_allocate_ip.go
- step_create_image.go
- step_get_password.go
- step_key_pair.go
- step_load_extensions.go
- step_load_flavor.go
- step_run_source_server.go
- step_stop_server.go
- step_update_image_visibility.go
- step_wait_for_rackconnect.go