Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F expose openstack image #3905

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion post-processor/shell-local/post-processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,14 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
envVars[1] = fmt.Sprintf("PACKER_BUILDER_TYPE='%s'", p.config.PackerBuilderType)
copy(envVars[2:], p.config.Vars)

for _, file := range artifact.Files() {
// By default, and for backward compatibility, iterate over the artifact's files.
// If there are no files, however, provide the Artifact.Id.
artifacts := artifact.Files()
if artifacts == nil {
artifacts = []string{artifact.Id()}
}

for _, file := range artifacts {
for _, script := range scripts {
// Flatten the environment variables
flattendVars := strings.Join(envVars, " ")
Expand Down
12 changes: 12 additions & 0 deletions website/source/docs/builders/openstack.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ builder.
- `floating_ip_pool` (string) - The name of the floating IP pool to use to
allocate a floating IP.

- `image_info_file` (string) - The name of the local file in which to write
`image_info_content`. By default this is "openstack-builder.json".
If empty, no file will be written. Use the [Artifice](https://www.packer.io/docs/post-processors/artifice.html) post-processor to make this available to
other post-processors.

- `image_info_content` (string) - The content to write to `image_info_file`.
By default this is "{ \"imageName\": \"{{.ImageName}}\", \"imageId\": \"{{.ImageId}}\" }\n"

- `insecure` (boolean) - Whether or not the connection to OpenStack can be
done over an insecure connection. By default this is false.

Expand Down Expand Up @@ -146,6 +154,10 @@ builder.
- `user_data_file` (string) - Path to a file that will be used for the user
data when launching the instance.

## Template Variables

The variables `ImageName` and `ImageId` are available for use by `image_info_content` after the builder has created the image in Openstack.

## Basic Example: DevStack

Here is a basic example. This is a example to build on DevStack running in a VM.
Expand Down