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
a0caa635
Commit
a0caa635
authored
Jun 16, 2014
by
Ross Smith II
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1261 from lflux/openstack-networks-support
Add ability to configure networks for openstack
parents
48ff225d
d99eff49
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletion
+12
-1
builder/openstack/builder.go
builder/openstack/builder.go
+1
-0
builder/openstack/run_config.go
builder/openstack/run_config.go
+1
-0
builder/openstack/step_run_source_server.go
builder/openstack/step_run_source_server.go
+7
-0
website/source/docs/builders/openstack.html.markdown
website/source/docs/builders/openstack.html.markdown
+3
-1
No files found.
builder/openstack/builder.go
View file @
a0caa635
...
...
@@ -92,6 +92,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Flavor
:
b
.
config
.
Flavor
,
SourceImage
:
b
.
config
.
SourceImage
,
SecurityGroups
:
b
.
config
.
SecurityGroups
,
Networks
:
b
.
config
.
Networks
,
},
&
StepAllocateIp
{
FloatingIpPool
:
b
.
config
.
FloatingIpPool
,
...
...
builder/openstack/run_config.go
View file @
a0caa635
...
...
@@ -20,6 +20,7 @@ type RunConfig struct {
FloatingIpPool
string
`mapstructure:"floating_ip_pool"`
FloatingIp
string
`mapstructure:"floating_ip"`
SecurityGroups
[]
string
`mapstructure:"security_groups"`
Networks
[]
string
`mapstructure:"networks"`
// Unexported fields that are calculated from others
sshTimeout
time
.
Duration
...
...
builder/openstack/step_run_source_server.go
View file @
a0caa635
...
...
@@ -13,6 +13,7 @@ type StepRunSourceServer struct {
Name
string
SourceImage
string
SecurityGroups
[]
string
Networks
[]
string
server
*
gophercloud
.
Server
}
...
...
@@ -30,12 +31,18 @@ func (s *StepRunSourceServer) Run(state multistep.StateBag) multistep.StepAction
securityGroups
[
i
][
"name"
]
=
groupName
}
networks
:=
make
([]
gophercloud
.
NetworkConfig
,
len
(
s
.
Networks
))
for
i
,
networkUuid
:=
range
s
.
Networks
{
networks
[
i
]
.
Uuid
=
networkUuid
}
server
:=
gophercloud
.
NewServer
{
Name
:
s
.
Name
,
ImageRef
:
s
.
SourceImage
,
FlavorRef
:
s
.
Flavor
,
KeyPairName
:
keyName
,
SecurityGroup
:
securityGroups
,
Networks
:
networks
,
}
serverResp
,
err
:=
csp
.
CreateServer
(
server
)
...
...
website/source/docs/builders/openstack.html.markdown
View file @
a0caa635
...
...
@@ -69,6 +69,9 @@ each category, the available configuration keys are alphabetized.
*
`insecure`
(boolean) - Whether or not the connection to OpenStack can be done
over an insecure connection. By default this is false.
*
`networks`
(array of strings) - A list of networks by UUID to attach
to this instance.
*
`openstack_provider`
(string)
<!---
@todo document me
...
...
@@ -89,7 +92,6 @@ each category, the available configuration keys are alphabetized.
<!---
@todo document me
-->
*
`security_groups`
(array of strings) - A list of security groups by name
to add to this instance.
...
...
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