Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
693f04af
Commit
693f04af
authored
Jun 12, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/openstack: AZ support
parent
44d86c2e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
24 deletions
+32
-24
builder/openstack/builder.go
builder/openstack/builder.go
+5
-4
builder/openstack/run_config.go
builder/openstack/run_config.go
+12
-11
builder/openstack/step_run_source_server.go
builder/openstack/step_run_source_server.go
+11
-9
website/source/docs/builders/openstack.html.markdown
website/source/docs/builders/openstack.html.markdown
+4
-0
No files found.
builder/openstack/builder.go
View file @
693f04af
...
...
@@ -75,10 +75,11 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
DebugKeyPath
:
fmt
.
Sprintf
(
"os_%s.pem"
,
b
.
config
.
PackerBuildName
),
},
&
StepRunSourceServer
{
Name
:
b
.
config
.
ImageName
,
SourceImage
:
b
.
config
.
SourceImage
,
SecurityGroups
:
b
.
config
.
SecurityGroups
,
Networks
:
b
.
config
.
Networks
,
Name
:
b
.
config
.
ImageName
,
SourceImage
:
b
.
config
.
SourceImage
,
SecurityGroups
:
b
.
config
.
SecurityGroups
,
Networks
:
b
.
config
.
Networks
,
AvailabilityZone
:
b
.
config
.
AvailabilityZone
,
},
&
StepWaitForRackConnect
{
Wait
:
b
.
config
.
RackconnectWait
,
...
...
builder/openstack/run_config.go
View file @
693f04af
...
...
@@ -11,17 +11,18 @@ import (
// RunConfig contains configuration for running an instance from a source
// image and details on how to access that launched image.
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"`
SSHInterface
string
`mapstructure:"ssh_interface"`
RackconnectWait
bool
`mapstructure:"rackconnect_wait"`
FloatingIpPool
string
`mapstructure:"floating_ip_pool"`
FloatingIp
string
`mapstructure:"floating_ip"`
SecurityGroups
[]
string
`mapstructure:"security_groups"`
Networks
[]
string
`mapstructure:"networks"`
SourceImage
string
`mapstructure:"source_image"`
Flavor
string
`mapstructure:"flavor"`
RawSSHTimeout
string
`mapstructure:"ssh_timeout"`
SSHUsername
string
`mapstructure:"ssh_username"`
SSHPort
int
`mapstructure:"ssh_port"`
SSHInterface
string
`mapstructure:"ssh_interface"`
AvailabilityZone
string
`mapstructure:"availability_zone"`
RackconnectWait
bool
`mapstructure:"rackconnect_wait"`
FloatingIpPool
string
`mapstructure:"floating_ip_pool"`
FloatingIp
string
`mapstructure:"floating_ip"`
SecurityGroups
[]
string
`mapstructure:"security_groups"`
Networks
[]
string
`mapstructure:"networks"`
// Not really used, but here for BC
OpenstackProvider
string
`mapstructure:"openstack_provider"`
...
...
builder/openstack/step_run_source_server.go
View file @
693f04af
...
...
@@ -11,10 +11,11 @@ import (
)
type
StepRunSourceServer
struct
{
Name
string
SourceImage
string
SecurityGroups
[]
string
Networks
[]
string
Name
string
SourceImage
string
SecurityGroups
[]
string
Networks
[]
string
AvailabilityZone
string
server
*
servers
.
Server
}
...
...
@@ -41,11 +42,12 @@ func (s *StepRunSourceServer) Run(state multistep.StateBag) multistep.StepAction
ui
.
Say
(
"Launching server..."
)
s
.
server
,
err
=
servers
.
Create
(
computeClient
,
keypairs
.
CreateOptsExt
{
CreateOptsBuilder
:
servers
.
CreateOpts
{
Name
:
s
.
Name
,
ImageRef
:
s
.
SourceImage
,
FlavorRef
:
flavor
,
SecurityGroups
:
s
.
SecurityGroups
,
Networks
:
networks
,
Name
:
s
.
Name
,
ImageRef
:
s
.
SourceImage
,
FlavorRef
:
flavor
,
SecurityGroups
:
s
.
SecurityGroups
,
Networks
:
networks
,
AvailabilityZone
:
s
.
AvailabilityZone
,
},
KeyName
:
keyName
,
...
...
website/source/docs/builders/openstack.html.markdown
View file @
693f04af
...
...
@@ -50,6 +50,10 @@ each category, the available configuration keys are alphabetized.
*
`api_key`
(string) - The API key used to access OpenStack. Some OpenStack
installations require this.
*
`availability_zone`
(string) - The availability zone to launch the
server in. If this isn't specified, the default enforced by your OpenStack
cluster will be used. This may be required for some OpenStack clusters.
*
`floating_ip`
(string) - A specific floating IP to assign to this instance.
`use_floating_ip`
must also be set to true for this to have an affect.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment