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
934e660a
Commit
934e660a
authored
May 06, 2014
by
Ross Smith II
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1121 from priteau/openstack-insecure
Allow OpenStack builder to skip certificate verification
parents
7b090528
2ee90b29
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
+15
-1
website/source/docs/builders/openstack.html.markdown
website/source/docs/builders/openstack.html.markdown
+3
-0
No files found.
builder/openstack/access_config.go
View file @
934e660a
package
openstack
package
openstack
import
(
import
(
"crypto/tls"
"fmt"
"fmt"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
...
@@ -21,6 +22,7 @@ type AccessConfig struct {
...
@@ -21,6 +22,7 @@ type AccessConfig struct {
RawRegion
string
`mapstructure:"region"`
RawRegion
string
`mapstructure:"region"`
ProxyUrl
string
`mapstructure:"proxy_url"`
ProxyUrl
string
`mapstructure:"proxy_url"`
TenantId
string
`mapstructure:"tenant_id"`
TenantId
string
`mapstructure:"tenant_id"`
Insecure
bool
`mapstructure:"insecure"`
}
}
// Auth returns a valid Auth object for access to openstack services, or
// Auth returns a valid Auth object for access to openstack services, or
...
@@ -51,6 +53,14 @@ func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error) {
...
@@ -51,6 +53,14 @@ func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error) {
Password
:
c
.
Password
,
Password
:
c
.
Password
,
}
}
default_transport
:=
&
http
.
Transport
{}
if
c
.
Insecure
{
cfg
:=
new
(
tls
.
Config
)
cfg
.
InsecureSkipVerify
=
true
default_transport
.
TLSClientConfig
=
cfg
}
// For corporate networks it may be the case where we want our API calls
// 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.
// to be sent through a separate HTTP proxy than external traffic.
if
c
.
ProxyUrl
!=
""
{
if
c
.
ProxyUrl
!=
""
{
...
@@ -61,7 +71,11 @@ func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error) {
...
@@ -61,7 +71,11 @@ func (c *AccessConfig) Auth() (gophercloud.AccessProvider, error) {
// The gophercloud.Context has a UseCustomClient method which
// The gophercloud.Context has a UseCustomClient method which
// would allow us to override with a new instance of http.Client.
// would allow us to override with a new instance of http.Client.
http
.
DefaultTransport
=
&
http
.
Transport
{
Proxy
:
http
.
ProxyURL
(
url
)}
default_transport
.
Proxy
=
http
.
ProxyURL
(
url
)
}
if
c
.
Insecure
||
c
.
ProxyUrl
!=
""
{
http
.
DefaultTransport
=
default_transport
}
}
return
gophercloud
.
Authenticate
(
c
.
Provider
,
authoptions
)
return
gophercloud
.
Authenticate
(
c
.
Provider
,
authoptions
)
...
...
website/source/docs/builders/openstack.html.markdown
View file @
934e660a
...
@@ -66,6 +66,9 @@ each category, the available configuration keys are alphabetized.
...
@@ -66,6 +66,9 @@ each category, the available configuration keys are alphabetized.
to allocate a floating IP.
`use_floating_ip`
must also be set to true
to allocate a floating IP.
`use_floating_ip`
must also be set to true
for this to have an affect.
for this to have an affect.
*
`insecure`
(boolean) - Whether or not the connection to OpenStack can be done
over an insecure connection. By default this is false.
*
`openstack_provider`
(string)
*
`openstack_provider`
(string)
<!---
<!---
@todo document me
@todo document me
...
...
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