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
e724b5fe
Commit
e724b5fe
authored
Jun 12, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/openstack: support legacy env vars
parent
50e2eb30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
44 deletions
+30
-44
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
+13
-44
No files found.
builder/openstack/access_config.go
View file @
e724b5fe
...
...
@@ -41,6 +41,23 @@ func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error {
c
.
Region
=
os
.
Getenv
(
"OS_REGION_NAME"
)
}
// Legacy RackSpace stuff. We're keeping this around to keep things BC.
if
c
.
APIKey
==
""
{
c
.
APIKey
=
os
.
Getenv
(
"SDK_API_KEY"
)
}
if
c
.
Password
==
""
{
c
.
Password
=
os
.
Getenv
(
"SDK_PASSWORD"
)
}
if
c
.
Region
==
""
{
c
.
Region
=
os
.
Getenv
(
"SDK_REGION"
)
}
if
c
.
TenantName
==
""
{
c
.
TenantName
=
os
.
Getenv
(
"SDK_PROJECT"
)
}
if
c
.
Username
==
""
{
c
.
Username
=
os
.
Getenv
(
"SDK_USERNAME"
)
}
// Get as much as possible from the end
ao
,
_
:=
openstack
.
AuthOptionsFromEnv
()
...
...
website/source/docs/builders/openstack.html.markdown
View file @
e724b5fe
...
...
@@ -34,23 +34,21 @@ each category, the available configuration keys are alphabetized.
*
`image_name`
(string) - The name of the resulting image.
*
`password`
(string) - The password used to connect to the OpenStack service.
If not specified, Packer will use the environment variables
`SDK_PASSWORD`
or
`OS_PASSWORD`
(in that order), if set.
*
`source_image`
(string) - The ID or full URL to the base image to use.
This is the image that will be used to launch a new server and provision it.
*
`username`
(string) - The username used to connect to the OpenStack service.
If not specified, Packer will use the environment variable
`OS_USERNAME`
, if set.
*
`password`
(string) - The password used to connect to the OpenStack service.
If not specified, Packer will use the environment variables
`
SDK_USERNAME`
or
`OS_USERNAME`
(in that order)
, if set.
`
OS_PASSWORD`
, if set.
### Optional:
*
`api_key`
(string) - The API key used to access OpenStack. Some OpenStack
installations require this.
If not specified, Packer will use the environment variables
`SDK_API_KEY`
, if set.
*
`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.
...
...
@@ -65,32 +63,18 @@ each category, the available configuration keys are alphabetized.
*
`networks`
(array of strings) - A list of networks by UUID to attach
to this instance.
*
`openstack_provider`
(string) - A name of a provider that has a slightly
different API model. Currently supported values are "openstack" (default),
and "rackspace".
*
`project`
(string) - The project name to boot the instance into. Some
OpenStack installations require this.
If not specified, Packer will use the environment variables
`SDK_PROJECT`
or
`OS_TENANT_NAME`
(in that order), if set.
*
`provider`
(string) - The provider used to connect to the OpenStack service.
If not specified, Packer will use the environment variables
`SDK_PROVIDER`
or
`OS_AUTH_URL`
(in that order), if set.
For Rackspace this should be
`rackspace-us`
or
`rackspace-uk`
.
*
`proxy_url`
(string)
*
`tenant_id`
or
`tenant_name`
(string) - The tenant ID or name to boot the
instance into. Some OpenStack installations require this.
If not specified, Packer will use the environment variable
`OS_TENANT_NAME`
, if set.
*
`security_groups`
(array of strings) - A list of security groups by name
to add to this instance.
*
`region`
(string) - The name of the region, such as "DFW", in which
to launch the server to create the AMI.
If not specified, Packer will use the environment variables
`SDK_REGION`
or
`OS_REGION_NAME`
(in that order), if set.
For a
`provider`
of "rackspace", it is required to specify a region,
either using this option or with an environment variable. For other
providers, including a private cloud, specifying a region is optional.
If not specified, Packer will use the environment variable
`OS_REGION_NAME`
, if set.
*
`ssh_port`
(integer) - The port that SSH will be available on. Defaults to port
22.
...
...
@@ -106,9 +90,6 @@ each category, the available configuration keys are alphabetized.
useful for Rackspace are "public" or "private", and the default behavior is
to connect via whichever is returned first from the OpenStack API.
*
`tenant_id`
(string) - Tenant ID for accessing OpenStack if your
installation requires this.
*
`use_floating_ip`
(boolean) - Whether or not to use a floating IP for
the instance. Defaults to false.
...
...
@@ -124,10 +105,8 @@ Ubuntu 12.04 LTS (Precise Pangolin) on Rackspace OpenStack cloud offering.
```
javascript
{
"
type
"
:
"
openstack
"
,
"
username
"
:
""
,
"
api_key
"
:
""
,
"
openstack_provider
"
:
"
rackspace
"
,
"
provider
"
:
"
rackspace-us
"
,
"
username
"
:
"
foo
"
,
"
password
"
:
"
foo
"
,
"
region
"
:
"
DFW
"
,
"
ssh_username
"
:
"
root
"
,
"
image_name
"
:
"
Test image
"
,
...
...
@@ -160,13 +139,3 @@ script is setting environment variables like:
*
`OS_TENANT_ID`
*
`OS_USERNAME`
*
`OS_PASSWORD`
## Troubleshooting
*I get the error "Missing or incorrect provider"*
*
Verify your "username", "password" and "provider" settings.
*I get the error "Missing endpoint, or insufficient privileges to access endpoint"*
*
Verify your "region" setting.
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