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
60c797b2
Commit
60c797b2
authored
Dec 06, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #637 from johnbellone/master
builder/openstack: add ProxyUrl parameter for OpenStack builder
parents
e1042cbc
e3af0ead
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
builder/openstack/access_config.go
builder/openstack/access_config.go
+17
-0
website/source/docs/builders/openstack.html.markdown
website/source/docs/builders/openstack.html.markdown
+1
-1
No files found.
builder/openstack/access_config.go
View file @
60c797b2
...
...
@@ -4,6 +4,8 @@ import (
"fmt"
"github.com/mitchellh/packer/packer"
"github.com/rackspace/gophercloud"
"net/http"
"net/url"
"os"
)
...
...
@@ -14,6 +16,7 @@ type AccessConfig struct {
Project
string
`mapstructure:"project"`
Provider
string
`mapstructure:"provider"`
RawRegion
string
`mapstructure:"region"`
ProxyUrl
string
`mapstructure:"proxy_url"`
}
// Auth returns a valid Auth object for access to openstack services, or
...
...
@@ -23,6 +26,7 @@ func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error) {
password
:=
c
.
Password
project
:=
c
.
Project
provider
:=
c
.
Provider
proxy
:=
c
.
ProxyUrl
if
username
==
""
{
username
=
os
.
Getenv
(
"SDK_USERNAME"
)
...
...
@@ -47,6 +51,19 @@ func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error) {
authoptions
.
TenantName
=
project
}
// For corporate networks it may be the case where we want our API calls
// to be sent through a separate HTTP proxy than external traffic.
if
proxy
!=
""
{
url
,
err
:=
url
.
Parse
(
proxy
)
if
err
!=
nil
{
return
nil
,
err
}
// The gophercloud.Context has a UseCustomClient method which
// would allow us to override with a new instance of http.Client.
http
.
DefaultTransport
=
&
http
.
Transport
{
Proxy
:
http
.
ProxyURL
(
url
)}
}
return
gophercloud
.
Authenticate
(
provider
,
authoptions
)
}
...
...
website/source/docs/builders/openstack.html.markdown
View file @
60c797b2
...
...
@@ -59,7 +59,7 @@ Optional:
*
`ssh_timeout`
(string) - The time to wait for SSH to become available
before timing out. The format of this value is a duration such as "5s"
or "
5m". The default SSH timeout is "1
m".
or "
1m". The default SSH timeout is "5
m".
*
`ssh_username`
(string) - The username to use in order to communicate
over SSH to the running server. The default is "root".
...
...
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