Merge pull request #8940 from hashicorp/je.new-website

New Docs Website!
This commit is contained in:
Megan Marsh 2020-04-07 15:15:27 -07:00 committed by GitHub
commit 9ed6fab8c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
742 changed files with 35422 additions and 17566 deletions

View File

@ -158,6 +158,28 @@ jobs:
at: .
- run: |
ghr -prerelease -t ${GITHUB_TOKEN_AZR} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./pkg/
build-website-docker-image:
docker:
- image: circleci/buildpack-deps
shell: /usr/bin/env bash -euo pipefail -c
steps:
- checkout
- setup_remote_docker
- run:
name: Build Docker Image if Necessary
command: |
IMAGE_TAG=$(cat website/Dockerfile website/package-lock.json | sha256sum | awk '{print $1;}')
echo "Using $IMAGE_TAG"
if curl https://hub.docker.com/v2/repositories/hashicorp/packer-website/tags/$IMAGE_TAG -fsL > /dev/null; then
echo "Dependencies have not changed, not building a new website docker image."
else
cd website/
docker build -t hashicorp/packer-website:$IMAGE_TAG .
docker tag hashicorp/packer-website:$IMAGE_TAG hashicorp/packer-website:latest
docker login -u $WEBSITE_DOCKER_USER -p $WEBSITE_DOCKER_PASS
docker push hashicorp/packer-website
fi
workflows:
version: 2
test:
@ -218,3 +240,10 @@ workflows:
ignore: /.*/
tags:
only: nightly
build_website_docker_image:
jobs:
- build-website-docker-image:
filters:
branches:
only:
- master

View File

@ -15,20 +15,20 @@ can quickly merge or address your contributions.
### Reporting an Issue
* Make sure you test against the latest released version. It is possible we
- Make sure you test against the latest released version. It is possible we
already fixed the bug you're experiencing.
* Run the command with debug output with the environment variable `PACKER_LOG`.
- Run the command with debug output with the environment variable `PACKER_LOG`.
For example: `PACKER_LOG=1 packer build template.json`. Take the _entire_
output and create a [gist](https://gist.github.com) for linking to in your
issue. Packer should strip sensitive keys from the output, but take a look
through just in case.
* Provide a reproducible test case. If a contributor can't reproduce an issue,
- Provide a reproducible test case. If a contributor can't reproduce an issue,
then it dramatically lowers the chances it'll get fixed. And in some cases,
the issue will eventually be closed.
* Respond promptly to any questions made by the Packer team to your issue. Stale
- Respond promptly to any questions made by the Packer team to your issue. Stale
issues will be closed.
### Issue Lifecycle
@ -86,23 +86,23 @@ The instructions below are for go 1.7. or later.
submitting a pull-request.
### Windows Systems
On windows systems you need at least the [MinGW Tools](http://www.mingw.org/), e.g. install via [choco](https://chocolatey.org/):
```
choco install mingw -y
```
This installs the GCC compiler, as well as a ```mingw32-make``` which can be used wherever
this documentation mentions ```make```
This installs the GCC compiler, as well as a `mingw32-make` which can be used wherever
this documentation mentions `make`
when building using ```go``` you also need to mention the windows
when building using `go` you also need to mention the windows
executable extension
```
go build -o bin/packer.exe
```
### Opening an Pull Request
Thank you for contributing! When you are ready to open a pull-request, you will
@ -131,37 +131,36 @@ to use `git push ...`.
### Pull Request Lifecycle
1. You are welcome to submit your pull request for commentary or review before
it is fully completed. Please prefix the title of your pull request with
"[WIP]" to indicate this. It's also a good idea to include specific questions
or items you'd like feedback on.
it is fully completed. Please prefix the title of your pull request with
"[WIP]" to indicate this. It's also a good idea to include specific questions
or items you'd like feedback on.
2. Once you believe your pull request is ready to be merged, you can remove any
"[WIP]" prefix from the title and a core team member will review.
"[WIP]" prefix from the title and a core team member will review.
3. One of Packer's core team members will look over your contribution and
either merge, or provide comments letting you know if there is anything left
to do. We do our best to provide feedback in a timely manner, but it may take
some time for us to respond. We may also have questions that we need answered
about the code, either because something doesn't make sense to us or because
we want to understand your thought process.
either merge, or provide comments letting you know if there is anything left
to do. We do our best to provide feedback in a timely manner, but it may take
some time for us to respond. We may also have questions that we need answered
about the code, either because something doesn't make sense to us or because
we want to understand your thought process.
4. If we have requested changes, you can either make those changes or, if you
disagree with the suggested changes, we can have a conversation about our
reasoning and agree on a path forward. This may be a multi-step process. Our
view is that pull requests are a chance to collaborate, and we welcome
conversations about how to do things better. It is the contributor's
responsibility to address any changes requested. While reviewers are happy to
give guidance, it is unsustainable for us to perform the coding work necessary
to get a PR into a mergeable state.
disagree with the suggested changes, we can have a conversation about our
reasoning and agree on a path forward. This may be a multi-step process. Our
view is that pull requests are a chance to collaborate, and we welcome
conversations about how to do things better. It is the contributor's
responsibility to address any changes requested. While reviewers are happy to
give guidance, it is unsustainable for us to perform the coding work necessary
to get a PR into a mergeable state.
5. Once all outstanding comments and checklist items have been addressed, your
contribution will be merged! Merged PRs will be included in the next
Packer release. The core team takes care of updating the
[CHANGELOG.md](../CHANGELOG.md) as they merge.
contribution will be merged! Merged PRs will be included in the next
Packer release. The core team takes care of updating the
[CHANGELOG.md](../CHANGELOG.md) as they merge.
6. In rare cases, we might decide that a PR should be closed without merging.
We'll make sure to provide clear reasoning when this happens.
We'll make sure to provide clear reasoning when this happens.
### Tips for Working on Packer
@ -250,7 +249,7 @@ does not attempt to track the latest version for each dependency.
Packer relies on `go generate` to generate a [peg parser for boot
commands](https://github.com/hashicorp/packer/blob/master/common/bootcommand/boot_command.go),
[docs](https://github.com/hashicorp/packer/blob/master/website/source/partials/builder/amazon/chroot/_Config-not-required.html.md)
[docs](https://github.com/hashicorp/packer/blob/master/website/pages/partials/builder/amazon/chroot/_Config-not-required.mdx)
and HCL2's bridging code. Packer's testing suite will run `make check-generate`
to check that all the generated files Packer needs are what they should be.
`make generate` re-generates all these file and can take a while depending on
@ -266,11 +265,13 @@ Packer relies on [golangci-lint](https://github.com/golangci/golangci-lint) for
The main configuration for golangci-lint is the `.golangci.yml` in the project root. See `golangci-lint --help` for a list of flags that can be used to override the default configuration.
Run golangci-lint on the entire Packer code base.
```
make lint
```
Run golangci-lint on a single pkg or directory; PKG_NAME expands to /builder/amazon/...
```
make lint PKG_NAME=builder/amazon
```

View File

@ -8,8 +8,8 @@ Issues on GitHub are intended to be related to bugs or feature requests, so we
recommend using our other community resources instead of asking here if you
have a question.
- Packer Guides: https://www.packer.io/guides/index.html
- Packer Guides: https://www.packer.io/guides
- Discussion List: https://groups.google.com/group/packer-tool
- Any other questions can be sent to the packer section of the HashiCorp
forum: https://discuss.hashicorp.com/c/packer
- Packer community links: https://www.packer.io/community.html
- Packer community links: https://www.packer.io/community

View File

@ -6,19 +6,18 @@ labels: communicator-question
Got one of the following errors ? See if the related guides can help.
* `Waiting for WinRM to become available` ?
- `Waiting for WinRM to become available` ?
- See our basic WinRm Packer guide: https://www.packer.io/guides/automatic-operating-system-installs/autounattend_windows.html
- See our basic WinRm Packer guide: https://www.packer.io/guides/automatic-operating-system-installs/autounattend_windows
* `Waiting for SSH to become available` ?
- See our basic SSH Packer guide: https://www.packer.io/guides/automatic-operating-system-installs/preseed_ubuntu.html
- `Waiting for SSH to become available` ?
- See our basic SSH Packer guide: https://www.packer.io/guides/automatic-operating-system-installs/preseed_ubuntu
Issues on GitHub are intended to be related to bugs or feature requests, so we recommend using our other community resources instead of asking here if you have a question.
- Packer Guides: https://www.packer.io/guides/index.html
- Packer Guides: https://www.packer.io/guides
- Discussion List: https://groups.google.com/group/packer-tool
- Any other questions can be sent to the packer section of the HashiCorp
forum: https://discuss.hashicorp.com/c/packer
- Packer community links: https://www.packer.io/community.html
- Packer community links: https://www.packer.io/community

View File

@ -3,61 +3,61 @@
# builders
/builder/alicloud/ @chhaj5236 @alexyueer
/website/source/docs/builders/alicloud* @chhaj5236 @alexyueer
/website/pages/docs/builders/alicloud* @chhaj5236 @alexyueer
/builder/azure/ @paulmey
/website/source/docs/builders/azure* @paulmey
/website/pages/docs/builders/azure* @paulmey
/builder/hyperv/ @taliesins
/website/source/docs/builders/hyperv* @taliesins
/website/pages/docs/builders/hyperv* @taliesins
/builder/jdcloud/ @XiaohanLiang @remrain
/website/source/docs/builders/jdcloud* @XiaohanLiang @remrain
/website/pages/docs/builders/jdcloud* @XiaohanLiang @remrain
/builder/linode/ @displague @ctreatma @stvnjacobs
/website/source/docs/builders/linode* @displague @ctreatma @stvnjacobs
/website/pages/docs/builders/linode* @displague @ctreatma @stvnjacobs
/builder/lxc/ @ChrisLundquist
/website/source/docs/builders/lxc* @ChrisLundquist
/website/pages/docs/builders/lxc* @ChrisLundquist
/builder/lxd/ @ChrisLundquist
/website/source/docs/builders/lxd* @ChrisLundquist
/website/pages/docs/builders/lxd* @ChrisLundquist
/builder/oneandone/ @jasmingacic
/website/source/docs/builders/oneandone* @jasmingacic
/website/pages/docs/builders/oneandone* @jasmingacic
/builder/oracle/ @prydie @owainlewis
/website/source/docs/builders/oracle* @prydie @owainlewis
/website/pages/docs/builders/oracle* @prydie @owainlewis
/builder/profitbricks/ @jasmingacic
/website/source/docs/builders/profitbricks* @jasmingacic
/website/pages/docs/builders/profitbricks* @jasmingacic
/builder/triton/ @sean-
/website/source/docs/builders/triton* @sean-
/website/pages/docs/builders/triton* @sean-
/builder/ncloud/ @YuSungDuk
/website/source/docs/builders/ncloud* @YuSungDuk
/website/pages/docs/builders/ncloud* @YuSungDuk
/builder/proxmox/ @carlpett
/website/source/docs/builders/proxmox* @carlpett
/website/pages/docs/builders/proxmox* @carlpett
/builder/scaleway/ @sieben @mvaude @jqueuniet @fflorens @brmzkw
/website/source/docs/builders/scaleway* @sieben @mvaude @jqueuniet @fflorens @brmzkw
/website/pages/docs/builders/scaleway* @sieben @mvaude @jqueuniet @fflorens @brmzkw
/builder/hcloud/ @LKaemmerling
/website/source/docs/builders/hcloud* @LKaemmerling
/website/pages/docs/builders/hcloud* @LKaemmerling
/builder/hyperone/ @m110 @gregorybrzeski @ad-m
/website/source/docs/builders/hyperone* @m110 @gregorybrzeski @ad-m
/website/pages/docs/builders/hyperone* @m110 @gregorybrzeski @ad-m
/builder/ucloud/ @shawnmssu
/website/source/docs/builders/ucloud* @shawnmssu
/website/pages/docs/builders/ucloud* @shawnmssu
/builder/yandex/ @GennadySpb @alexanderKhaustov @seukyaso
/website/source/docs/builders/yandex* @GennadySpb @alexanderKhaustov @seukyaso
/website/pages/docs/builders/yandex* @GennadySpb @alexanderKhaustov @seukyaso
/builder/osc/ @marinsalinas
/website/source/docs/builders/osc* @marinsalinas
/website/pages/docs/builders/osc* @marinsalinas
# provisioners

View File

@ -108,7 +108,7 @@ mode-check: ## Check that only certain files are executable
echo "Check passed."; \
fi
fmt-docs:
@find ./website/source/docs -name "*.md" -exec pandoc --wrap auto --columns 79 --atx-headers -s -f "markdown_github+yaml_metadata_block" -t "markdown_github+yaml_metadata_block" {} -o {} \;
@find ./website/pages/docs -name "*.md" -exec pandoc --wrap auto --columns 79 --atx-headers -s -f "markdown_github+yaml_metadata_block" -t "markdown_github+yaml_metadata_block" {} -o {} \;
# Install js-beautify with npm install -g js-beautify
fmt-examples:
@ -118,7 +118,7 @@ fmt-examples:
# source files.
generate: install-gen-deps ## Generate dynamically generated code
@echo "==> removing autogenerated markdown..."
@find website/source/ -type f | xargs grep -l '^<!-- Code generated' | xargs rm
@find website/pages/ -type f | xargs grep -l '^<!-- Code generated' | xargs rm
@echo "==> removing autogenerated code..."
@find post-processor common helper template builder provisioner -type f | xargs grep -l '^// Code generated' | xargs rm
go generate ./...

View File

@ -17,7 +17,7 @@ type AlicloudDiskDevice struct {
// 128] English or Chinese characters, must begin with an
// uppercase/lowercase letter or Chinese character. Can contain numbers,
// ., _ and -. The disk name will appear on the console. It cannot
// begin with http:// or https://.
// begin with `http://` or `https://`.
DiskName string `mapstructure:"disk_name" required:"false"`
// Category of the system disk. Optional values
// are:
@ -35,7 +35,7 @@ type AlicloudDiskDevice struct {
SnapshotId string `mapstructure:"disk_snapshot_id" required:"false"`
// The value of disk description is blank by
// default. [2, 256] characters. The disk description will appear on the
// console. It cannot begin with http:// or https://.
// console. It cannot begin with `http://` or `https://`.
Description string `mapstructure:"disk_description" required:"false"`
// Whether or not the disk is
// released along with the instance:
@ -61,9 +61,9 @@ type AlicloudDiskDevices struct {
// - `cloud_efficiency` - efficiency cloud disk
// - `cloud_ssd` - cloud SSD
//
// For phased-out instance types and non-I/O optimized instances, the
// default value is cloud. Otherwise, the default value is
// cloud\_efficiency.
// For phased-out instance types and non-I/O optimized instances, the
// default value is cloud. Otherwise, the default value is
// cloud\_efficiency.
//
// - `disk_description` (string) - The value of disk description is blank by
// default. \[2, 256\] characters. The disk description will appear on the
@ -139,14 +139,14 @@ type AlicloudImageConfig struct {
// The name of the user-defined image, [2, 128]
// English or Chinese characters. It must begin with an uppercase/lowercase
// letter or a Chinese character, and may contain numbers, _ or -. It
// cannot begin with http:// or https://.
// cannot begin with `http://` or `https://`.
AlicloudImageName string `mapstructure:"image_name" required:"true"`
// The version number of the image, with a length
// limit of 1 to 40 English characters.
AlicloudImageVersion string `mapstructure:"image_version" required:"false"`
// The description of the image, with a length
// limit of 0 to 256 characters. Leaving it blank means null, which is the
// default value. It cannot begin with http:// or https://.
// default value. It cannot begin with `http://` or `https://`.
AlicloudImageDescription string `mapstructure:"image_description" required:"false"`
// The IDs of to-be-added Aliyun
// accounts to which the image is shared. The number of accounts is 1 to 10.
@ -158,7 +158,7 @@ type AlicloudImageConfig struct {
// The name of the destination image,
// [2, 128] English or Chinese characters. It must begin with an
// uppercase/lowercase letter or a Chinese character, and may contain numbers,
// _ or -. It cannot begin with http:// or https://.
// _ or -. It cannot begin with `http://` or `https://`.
AlicloudImageDestinationNames []string `mapstructure:"image_copy_names" required:"false"`
// Whether or not to encrypt the target images, including those copied if image_copy_regions is specified. If this option
// is set to true, a temporary image will be created from the provisioned
@ -171,13 +171,13 @@ type AlicloudImageConfig struct {
// images and then create the target images, otherwise, the creation will
// fail. The default value is false. Check `image_name` and
// `image_copy_names` options for names of target images. If
// [-force](https://packer.io/docs/commands/build.html#force) option is
// [-force](/docs/commands/build#force) option is
// provided in `build` command, this option can be omitted and taken as
// true.
AlicloudImageForceDelete bool `mapstructure:"image_force_delete" required:"false"`
// If this value is true, when delete the duplicated existing images, the
// source snapshots of those images will be delete either. If
// [-force](https://packer.io/docs/commands/build.html#force) option is
// [-force](/docs/commands/build#force) option is
// provided in `build` command, this option can be omitted and taken as
// true.
AlicloudImageForceDeleteSnapshots bool `mapstructure:"image_force_delete_snapshots" required:"false"`
@ -194,7 +194,7 @@ type AlicloudImageConfig struct {
AlicloudImageTags map[string]string `mapstructure:"tags" required:"false"`
// Same as [`tags`](#tags) but defined as a singular repeatable block
// containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
AlicloudImageTag hcl2template.NameValues `mapstructure:"tag" required:"false"`
AlicloudDiskDevices `mapstructure:",squash"`

View File

@ -57,7 +57,7 @@ type RunConfig struct {
// The security group name. The default value
// is blank. [2, 128] English or Chinese characters, must begin with an
// uppercase/lowercase letter or Chinese character. Can contain numbers, .,
// _ or -. It cannot begin with http:// or https://.
// _ or -. It cannot begin with `http://` or `https://`.
SecurityGroupName string `mapstructure:"security_group_name" required:"false"`
// User data to apply when launching the instance. Note
// that you need to be careful about escaping characters due to the templates
@ -73,8 +73,8 @@ type RunConfig struct {
// The VPC name. The default value is blank. [2, 128]
// English or Chinese characters, must begin with an uppercase/lowercase
// letter or Chinese character. Can contain numbers, _ and -. The disk
// description will appear on the console. Cannot begin with http:// or
// https://.
// description will appear on the console. Cannot begin with `http://` or
// `https://`.
VpcName string `mapstructure:"vpc_name" required:"false"`
// Value options: 192.168.0.0/16 and
// 172.16.0.0/16. When not specified, the default value is 172.16.0.0/16.

View File

@ -48,11 +48,11 @@ type Config struct {
// in the Chroot Mounts section. Please read that section for more
// information on how to use this.
ChrootMounts [][]string `mapstructure:"chroot_mounts" required:"false"`
// How to run shell commands. This defaults to {{.Command}}. This may be
// How to run shell commands. This defaults to `{{.Command}}`. This may be
// useful to set if you want to set environmental variables or perhaps run
// it with sudo or so on. This is a configuration template where the
// .Command variable is replaced with the command to be run. Defaults to
// {{.Command}}.
// `{{.Command}}`.
CommandWrapper string `mapstructure:"command_wrapper" required:"false"`
// Paths to files on the running EC2 instance that will be copied into the
// chroot environment prior to provisioning. Defaults to /etc/resolv.conf
@ -90,18 +90,18 @@ type Config struct {
MountPartition string `mapstructure:"mount_partition" required:"false"`
// The path where the volume will be mounted. This is where the chroot
// environment will be. This defaults to
// /mnt/packer-amazon-chroot-volumes/{{.Device}}. This is a configuration
// `/mnt/packer-amazon-chroot-volumes/{{.Device}}`. This is a configuration
// template where the .Device variable is replaced with the name of the
// device where the volume is attached.
MountPath string `mapstructure:"mount_path" required:"false"`
// As pre_mount_commands, but the commands are executed after mounting the
// root device and before the extra mount and copy steps. The device and
// mount path are provided by {{.Device}} and {{.MountPath}}.
// mount path are provided by `{{.Device}}` and `{{.MountPath}}`.
PostMountCommands []string `mapstructure:"post_mount_commands" required:"false"`
// A series of commands to execute after attaching the root volume and
// before mounting the chroot. This is not required unless using
// from_scratch. If so, this should include any partitioning and filesystem
// creation commands. The path to the device is provided by {{.Device}}.
// creation commands. The path to the device is provided by `{{.Device}}`.
PreMountCommands []string `mapstructure:"pre_mount_commands" required:"false"`
// The root device name. For example, xvda.
RootDeviceName string `mapstructure:"root_device_name" required:"false"`
@ -161,12 +161,12 @@ type Config struct {
//filter, but will cause Packer to fail if the `source_ami` does not exist.
SourceAmiFilter awscommon.AmiFilterOptions `mapstructure:"source_ami_filter" required:"false"`
// Tags to apply to the volumes that are *launched*. This is a [template
// engine](/docs/templates/engine.html), see [Build template
// engine](/docs/templates/engine), see [Build template
// data](#build-template-data) for more information.
RootVolumeTags map[string]string `mapstructure:"root_volume_tags" required:"false"`
// Same as [`root_volume_tags`](#root_volume_tags) but defined as a
// singular block containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
RootVolumeTag hcl2template.NameValues `mapstructure:"root_volume_tag" required:"false"`
// what architecture to use when registering the final AMI; valid options

View File

@ -44,7 +44,7 @@ func (v *VaultAWSEngineOptions) Empty() bool {
// AccessConfig is for common configuration related to AWS access
type AccessConfig struct {
// The access key used to communicate with AWS. [Learn how to set this]
// (/docs/builders/amazon.html#specifying-amazon-credentials). On EBS, this
// (/docs/builders/amazon#specifying-amazon-credentials). On EBS, this
// is not required if you are using `use_vault_aws_engine` for
// authentication instead.
AccessKey string `mapstructure:"access_key" required:"true"`
@ -79,7 +79,7 @@ type AccessConfig struct {
// When chroot building, this value is guessed from environment.
RawRegion string `mapstructure:"region" required:"true"`
// The secret key used to communicate with AWS. [Learn how to set
// this](amazon.html#specifying-amazon-credentials). This is not required
// this](/docs/builders/amazon#specifying-amazon-credentials). This is not required
// if you are using `use_vault_aws_engine` for authentication instead.
SecretKey string `mapstructure:"secret_key" required:"true"`
// Set to true if you want to skip
@ -95,7 +95,7 @@ type AccessConfig struct {
// Get credentials from Hashicorp Vault's aws secrets engine. You must
// already have created a role to use. For more information about
// generating credentials via the Vault engine, see the [Vault
// docs.](https://www.vaultproject.io/api/secret/aws/index.html#generate-credentials)
// docs.](https://www.vaultproject.io/api/secret/aws#generate-credentials)
// If you set this flag, you must also set the below options:
// - `name` (string) - Required. Specifies the name of the role to generate
// credentials against. This is part of the request URL.
@ -190,7 +190,7 @@ func (c *AccessConfig) Session() (*session.Session, error) {
if isAWSErr(err, "NoCredentialProviders", "") {
return nil, fmt.Errorf("No valid credential sources found for AWS Builder. " +
"Please see https://www.packer.io/docs/builders/amazon.html#specifying-amazon-credentials " +
"Please see https://www.packer.io/docs/builders/amazon#specifying-amazon-credentials " +
"for more information on providing credentials for the AWS Builder.")
}

View File

@ -17,11 +17,11 @@ type AMIConfig struct {
// The name of the resulting AMI that will appear when managing AMIs in the
// AWS console or via APIs. This must be unique. To help make this unique,
// use a function like timestamp (see [template
// engine](../templates/engine.html) for more info).
// engine](/docs/templates/engine) for more info).
AMIName string `mapstructure:"ami_name" required:"true"`
// The description to set for the resulting
// AMI(s). By default this description is empty. This is a
// [template engine](/docs/templates/engine.html), see [Build template
// [template engine](/docs/templates/engine), see [Build template
// data](#build-template-data) for more information.
AMIDescription string `mapstructure:"ami_description" required:"false"`
// The type of virtualization for the AMI
@ -48,12 +48,12 @@ type AMIConfig struct {
// validation of the ami_regions configuration option. Default false.
AMISkipRegionValidation bool `mapstructure:"skip_region_validation" required:"false"`
// Tags applied to the AMI. This is a
// [template engine](/docs/templates/engine.html), see [Build template
// [template engine](/docs/templates/engine), see [Build template
// data](#build-template-data) for more information.
AMITags map[string]string `mapstructure:"tags" required:"false"`
// Same as [`tags`](#tags) but defined as a singular repeatable block
// containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
AMITag hcl2template.NameValues `mapstructure:"tag" required:"false"`
// Enable enhanced networking (ENA but not SriovNetSupport) on
@ -119,12 +119,12 @@ type AMIConfig struct {
AMISkipBuildRegion bool `mapstructure:"skip_save_build_region"`
// Tags to apply to snapshot.
// They will override AMI tags if already applied to snapshot. This is a
// [template engine](../templates/engine.html), see [Build template
// [template engine](/docs/templates/engine), see [Build template
// data](#build-template-data) for more information.
SnapshotTags map[string]string `mapstructure:"snapshot_tags" required:"false"`
// Same as [`snapshot_tags`](#snapshot_tags) but defined as a singular
// repeatable block containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
SnapshotTag hcl2template.NameValues `mapstructure:"snapshot_tag" required:"false"`
// A list of account IDs that have
@ -210,7 +210,7 @@ func (c *AMIConfig) Prepare(accessConfig *AccessConfig, ctx *interpolate.Context
if len(c.SnapshotUsers) > 0 {
if len(c.AMIKmsKeyId) == 0 && len(c.AMIRegionKMSKeyIDs) == 0 && c.AMIEncryptBootVolume.True() {
errs = append(errs, fmt.Errorf("Cannot share snapshot encrypted "+
"with default KMS key, see https://www.packer.io/docs/builders/amazon-ebs.html#region_kms_key_ids for more information"))
"with default KMS key, see https://www.packer.io/docs/builders/amazon-ebs#region_kms_key_ids for more information"))
}
if len(c.AMIRegionKMSKeyIDs) > 0 {
for _, kmsKey := range c.AMIRegionKMSKeyIDs {

View File

@ -90,7 +90,7 @@ type RunConfig struct {
// *will not* stop the instance but will assume that you will send the stop
// signal yourself through your final provisioner. You can do this with a
// [windows-shell
// provisioner](https://www.packer.io/docs/provisioners/windows-shell.html).
// provisioner](/docs/provisioners/windows-shell).
// Note that Packer will still wait for the instance to be stopped, and
// failing to send the stop signal yourself, when you have set this flag to
// `true`, will cause a timeout.
@ -184,12 +184,12 @@ type RunConfig struct {
// `security_group_ids` take precedence over this.
SecurityGroupFilter SecurityGroupFilterOptions `mapstructure:"security_group_filter" required:"false"`
// Tags to apply to the instance that is that is *launched* to create the
// EBS volumes. This is a [template engine](/docs/templates/engine.html),
// EBS volumes. This is a [template engine](/docs/templates/engine),
// see [Build template data](#build-template-data) for more information.
RunTags map[string]string `mapstructure:"run_tags" required:"false"`
// Same as [`run_tags`](#run_tags) but defined as a singular repeatable
// block containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
RunTag hcl2template.NameValues `mapstructure:"run_tag" required:"false"`
// The ID (not the name) of the security
@ -286,7 +286,7 @@ type RunConfig struct {
SpotTags map[string]string `mapstructure:"spot_tags" required:"false"`
// Same as [`spot_tags`](#spot_tags) but defined as a singular repeatable block
// containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
SpotTag hcl2template.NameValues `mapstructure:"spot_tag" required:"false"`
// Filters used to populate the `subnet_id` field.

View File

@ -52,7 +52,7 @@ type Config struct {
// Tags to apply to the volumes that are *launched* to create the AMI.
// These tags are *not* applied to the resulting AMI unless they're
// duplicated in `tags`. This is a [template
// engine](/docs/templates/engine.html), see [Build template
// engine](/docs/templates/engine), see [Build template
// data](#build-template-data) for more information.
VolumeRunTags awscommon.TagMap `mapstructure:"run_volume_tags"`
// Relevant only to Windows guests: If you set this flag, we'll add clauses

View File

@ -58,7 +58,7 @@ type Config struct {
// Tags to apply to the volumes that are *launched* to create the AMI.
// These tags are *not* applied to the resulting AMI unless they're
// duplicated in `tags`. This is a [template
// engine](/docs/templates/engine.html), see [Build template
// engine](/docs/templates/engine), see [Build template
// data](#build-template-data) for more information.
VolumeRunTags awscommon.TagMap `mapstructure:"run_volume_tags"`
// what architecture to use when registering the

View File

@ -12,12 +12,12 @@ import (
type BlockDevice struct {
awscommon.BlockDevice `mapstructure:",squash"`
// Tags to apply to the volume. These are retained after the builder
// completes. This is a [template engine](/docs/templates/engine.html), see
// completes. This is a [template engine](/docs/templates/engine), see
// [Build template data](#build-template-data) for more information.
Tags map[string]string `mapstructure:"tags" required:"false"`
// Same as [`tags`](#tags) but defined as a singular repeatable block
// containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
Tag hcl2template.NameValues `mapstructure:"tag" required:"false"`
}

View File

@ -57,7 +57,7 @@ type Config struct {
// create EBS Volumes. These tags will *not* appear in the tags of the
// resulting EBS volumes unless they're duplicated under `tags` in the
// `ebs_volumes` setting. This is a [template
// engine](/docs/templates/engine.html), see [Build template
// engine](/docs/templates/engine), see [Build template
// data](#build-template-data) for more information.
//
// Note: The tags specified here will be *temporarily* applied to volumes
@ -69,7 +69,7 @@ type Config struct {
// Same as [`run_volume_tags`](#run_volume_tags) but defined as a singular
// repeatable block containing a `name` and a `value` field. In HCL2 mode
// the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
VolumeRunTag hcl2template.NameValues `mapstructure:"run_volume_tag"`

View File

@ -61,7 +61,7 @@ type Config struct {
// exist and be writable.
BundleDestination string `mapstructure:"bundle_destination" required:"false"`
// The prefix for files created from bundling the root volume. By default
// this is image-{{timestamp}}. The timestamp variable should be used to
// this is `image-{{timestamp}}`. The timestamp variable should be used to
// make sure this is unique, otherwise it can collide with other created
// AMIs by Packer in your account.
BundlePrefix string `mapstructure:"bundle_prefix" required:"false"`

View File

@ -245,7 +245,7 @@ type Config struct {
AzureTags map[string]*string `mapstructure:"azure_tags" required:"false"`
// Same as [`azure_tags`](#azure_tags) but defined as a singular repeatable block
// containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
AzureTag hcl2template.NameValues `mapstructure:"azure_tag" required:"false"`
// Resource group under which the final artifact will be stored.

View File

@ -103,32 +103,34 @@ type Config struct {
// as the source for this build. *VHD targets are incompatible with this
// build type* - the target must be a *Managed Image*.
//
// "shared_image_gallery": {
// "subscription": "00000000-0000-0000-0000-00000000000",
// "resource_group": "ResourceGroup",
// "gallery_name": "GalleryName",
// "image_name": "ImageName",
// "image_version": "1.0.0"
// }
// "managed_image_name": "TargetImageName",
// "managed_image_resource_group_name": "TargetResourceGroup"
// ```json
// "shared_image_gallery": {
// "subscription": "00000000-0000-0000-0000-00000000000",
// "resource_group": "ResourceGroup",
// "gallery_name": "GalleryName",
// "image_name": "ImageName",
// "image_version": "1.0.0"
// }
// "managed_image_name": "TargetImageName",
// "managed_image_resource_group_name": "TargetResourceGroup"
// ```
SharedGallery SharedImageGallery `mapstructure:"shared_image_gallery"`
// The name of the Shared Image Gallery under which the managed image will be published as Shared Gallery Image version.
//
// Following is an example.
//
// <!-- -->
//
// "shared_image_gallery_destination": {
// "resource_group": "ResourceGroup",
// "gallery_name": "GalleryName",
// "image_name": "ImageName",
// "image_version": "1.0.0",
// "replication_regions": ["regionA", "regionB", "regionC"]
// }
// "managed_image_name": "TargetImageName",
// "managed_image_resource_group_name": "TargetResourceGroup"
// ```json
// "shared_image_gallery_destination": {
// "resource_group": "ResourceGroup",
// "gallery_name": "GalleryName",
// "image_name": "ImageName",
// "image_version": "1.0.0",
// "replication_regions": ["regionA", "regionB", "regionC"]
// }
// "managed_image_name": "TargetImageName",
// "managed_image_resource_group_name": "TargetResourceGroup"
// ```
SharedGalleryDestination SharedImageGalleryDestination `mapstructure:"shared_image_gallery_destination"`
// How long to wait for an image to be published to the shared image

View File

@ -114,7 +114,7 @@ type Config struct {
SourceTemplate string `mapstructure:"source_template" required:"true"`
// The name of the temporary SSH key pair
// to generate. By default, Packer generates a name that looks like
// packer_<UUID>, where <UUID> is a 36 character unique identifier.
// `packer_<UUID>`, where `<UUID>` is a 36 character unique identifier.
TemporaryKeypairName string `mapstructure:"temporary_keypair_name" required:"false"`
// Set to true to indicate that the
// provisioners should connect to the local IP address of the instance.
@ -134,7 +134,7 @@ type Config struct {
// created.
Zone string `mapstructure:"zone" required:"true"`
// The name of the new template. Defaults to
// "packer-{{timestamp}}" where timestamp will be the current time.
// `packer-{{timestamp}}` where timestamp will be the current time.
TemplateName string `mapstructure:"template_name" required:"false"`
// The display text of the new template.
// Defaults to the template_name.

View File

@ -55,7 +55,7 @@ type Config struct {
// created. This defaults to false, or not enabled.
IPv6 bool `mapstructure:"ipv6" required:"false"`
// The name of the resulting snapshot that will
// appear in your account. Defaults to "packer-{{timestamp}}" (see
// appear in your account. Defaults to `packer-{{timestamp}}` (see
// configuration templates for more info).
SnapshotName string `mapstructure:"snapshot_name" required:"false"`
// The regions of the resulting

View File

@ -36,12 +36,12 @@ type Config struct {
Commit bool `mapstructure:"commit" required:"true"`
// The directory inside container to mount temp directory from host server
// for work [file provisioner](/docs/provisioners/file.html). This defaults
// for work [file provisioner](/docs/provisioners/file). This defaults
// to c:/packer-files on windows and /packer-files on other systems.
ContainerDir string `mapstructure:"container_dir" required:"false"`
// Throw away the container when the build is complete. This is useful for
// the [artifice
// post-processor](https://www.packer.io/docs/post-processors/artifice.html).
// post-processor](/docs/post-processors/artifice).
Discard bool `mapstructure:"discard" required:"true"`
// Username (UID) to run remote commands with. You can also set the group
// name/ID if you want: (UID or UID:GID). You may need this if you get
@ -63,10 +63,10 @@ type Config struct {
// used. This defaults to true if not set.
Pull bool `mapstructure:"pull" required:"false"`
// An array of arguments to pass to docker run in order to run the
// container. By default this is set to ["-d", "-i", "-t",
// "--entrypoint=/bin/sh", "--", "{{.Image}}"] if you are using a linux
// container, and ["-d", "-i", "-t", "--entrypoint=powershell", "--",
// "{{.Image}}"] if you are running a windows container. {{.Image}} is a
// container. By default this is set to `["-d", "-i", "-t",
// "--entrypoint=/bin/sh", "--", "{{.Image}}"]` if you are using a linux
// container, and `["-d", "-i", "-t", "--entrypoint=powershell", "--",
// "{{.Image}}"]` if you are running a windows container. `{{.Image}}` is a
// template variable that corresponds to the image template option. Passing
// the entrypoint option this way will make it the default entrypoint of
// the resulting image, so running docker run -it --rm will start the

View File

@ -58,7 +58,7 @@ type Config struct {
// Defaults to pd-standard.
DiskType string `mapstructure:"disk_type" required:"false"`
// The unique name of the resulting image. Defaults to
// "packer-{{timestamp}}".
// `packer-{{timestamp}}`.
ImageName string `mapstructure:"image_name" required:"false"`
// The description of the resulting image.
ImageDescription string `mapstructure:"image_description" required:"false"`
@ -84,7 +84,7 @@ type Config struct {
// Licenses to apply to the created image.
ImageLicenses []string `mapstructure:"image_licenses" required:"false"`
// A name to give the launched instance. Beware that this must be unique.
// Defaults to "packer-{{uuid}}".
// Defaults to `packer-{{uuid}}`.
InstanceName string `mapstructure:"instance_name" required:"false"`
// Key/value pair labels to apply to the launched instance.
Labels map[string]string `mapstructure:"labels" required:"false"`
@ -172,7 +172,7 @@ type Config struct {
// Google's cloud. The value should be the path of the token generator
// within vault.
// For information on how to configure your Vault + GCP engine to produce
// Oauth tokens, see https://www.vaultproject.io/docs/auth/gcp.html
// Oauth tokens, see https://www.vaultproject.io/docs/auth/gcp
// You must have the environment variables VAULT_ADDR and VAULT_TOKEN set,
// along with any other relevant variables for accessing your vault
// instance. For more information, see the Vault docs:

View File

@ -56,7 +56,7 @@ type Config struct {
// ID or name of the image to launch server from.
SourceImage string `mapstructure:"source_image" required:"true"`
// The name of the resulting image. Defaults to
// "packer-{{timestamp}}"
// `packer-{{timestamp}}`
// (see configuration templates for more info).
ImageName string `mapstructure:"image_name" required:"false"`
// The description of the resulting image.
@ -65,7 +65,7 @@ type Config struct {
ImageTags map[string]string `mapstructure:"image_tags" required:"false"`
// Same as [`image_tags`](#image_tags) but defined as a singular repeatable
// block containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
ImageTag hcl2template.NameValues `mapstructure:"image_tag" required:"false"`
// The service of the resulting image.
@ -79,7 +79,7 @@ type Config struct {
VmTags map[string]string `mapstructure:"vm_tags" required:"false"`
// Same as [`vm_tags`](#vm_tags) but defined as a singular repeatable block
// containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
VmTag hcl2template.NameValues `mapstructure:"vm_tag" required:"false"`
// The name of the created disk.
@ -107,11 +107,11 @@ type Config struct {
ChrootMountPath string `mapstructure:"chroot_mount_path"`
ChrootMounts [][]string `mapstructure:"chroot_mounts"`
ChrootCopyFiles []string `mapstructure:"chroot_copy_files"`
// How to run shell commands. This defaults to {{.Command}}. This may be
// How to run shell commands. This defaults to `{{.Command}}`. This may be
// useful to set if you want to set environmental variables or perhaps run
// it with sudo or so on. This is a configuration template where the
// .Command variable is replaced with the command to be run. Defaults to
// {{.Command}}.
// `{{.Command}}`.
ChrootCommandWrapper string `mapstructure:"chroot_command_wrapper"`
MountOptions []string `mapstructure:"mount_options"`
@ -119,11 +119,11 @@ type Config struct {
// A series of commands to execute after attaching the root volume and
// before mounting the chroot. This is not required unless using
// from_scratch. If so, this should include any partitioning and filesystem
// creation commands. The path to the device is provided by {{.Device}}.
// creation commands. The path to the device is provided by `{{.Device}}`.
PreMountCommands []string `mapstructure:"pre_mount_commands"`
// As pre_mount_commands, but the commands are executed after mounting the
// root device and before the extra mount and copy steps. The device and
// mount path are provided by {{.Device}} and {{.MountPath}}.
// mount path are provided by `{{.Device}}` and `{{.MountPath}}`.
PostMountCommands []string `mapstructure:"post_mount_commands"`
// List of SSH keys by name or id to be added
// to the server on launch.

View File

@ -20,11 +20,11 @@ type Config struct {
// The path to the lxc configuration file.
ConfigFile string `mapstructure:"config_file" required:"true"`
// The directory in which to save the exported
// tar.gz. Defaults to output-<BuildName> in the current directory.
// tar.gz. Defaults to `output-<BuildName>` in the current directory.
OutputDir string `mapstructure:"output_directory" required:"false"`
// The name of the LXC container. Usually stored
// in /var/lib/lxc/containers/<container_name>. Defaults to
// packer-<BuildName>.
// in `/var/lib/lxc/containers/<container_name>`. Defaults to
// `packer-<BuildName>`.
ContainerName string `mapstructure:"container_name" required:"false"`
// Allows you to specify a wrapper command, such
// as ssh so you can execute packer builds on a remote host. Defaults to
@ -53,7 +53,7 @@ type Config struct {
Name string `mapstructure:"template_name" required:"true"`
// Options to pass to the given
// lxc-template command, usually located in
// /usr/share/lxc/templates/lxc-<template_name>. Note: This gets passed as
// `/usr/share/lxc/templates/lxc-<template_name>`. Note: This gets passed as
// ARGV to the template command. Ensure you have an array of strings, as a
// single string with spaces probably won't work. Defaults to [].
Parameters []string `mapstructure:"template_parameters" required:"false"`

View File

@ -20,7 +20,7 @@ type Config struct {
OutputImage string `mapstructure:"output_image" required:"false"`
ContainerName string `mapstructure:"container_name"`
// Lets you prefix all builder commands, such as
// with ssh for a remote build host. Defaults to "{{.Command}}"; i.e. no
// with ssh for a remote build host. Defaults to `{{.Command}}`; i.e. no
// wrapper.
CommandWrapper string `mapstructure:"command_wrapper" required:"false"`
// The source image to use when creating the build

View File

@ -66,13 +66,9 @@ type RunConfig struct {
// following are valid:
//
// - name (string)
//
// - owner (string)
//
// - tags (array of strings)
//
// - visibility (string)
//
// - properties (map of strings to strings) (fields that can be set
// with `openstack image set --property key=value`)
//

View File

@ -29,7 +29,7 @@ type ToolsConfig struct {
// is "upload". This is a configuration
// template that has a single
// valid variable: Flavor, which will be the value of
// parallels_tools_flavor. By default this is "prl-tools-{{.Flavor}}.iso"
// parallels_tools_flavor. By default this is `prl-tools-{{.Flavor}}.iso`
// which should upload into the login directory of the user.
ParallelsToolsGuestPath string `mapstructure:"parallels_tools_guest_path" required:"false"`
// The method by which Parallels Tools are

View File

@ -65,7 +65,7 @@ type Config struct {
HardDriveInterface string `mapstructure:"hard_drive_interface" required:"false"`
// A list of which interfaces on the
// host should be searched for a IP address. The first IP address found on one
// of these will be used as {{ .HTTPIP }} in the boot_command. Defaults to
// of these will be used as `{{ .HTTPIP }}` in the boot_command. Defaults to
// ["en0", "en1", "en2", "en3", "en4", "en5", "en6", "en7", "en8", "en9",
// "ppp0", "ppp1", "ppp2"].
HostInterfaces []string `mapstructure:"host_interfaces" required:"false"`

View File

@ -86,7 +86,7 @@ type TencentCloudRunConfig struct {
RunTags map[string]string `mapstructure:"run_tags" required:"false"`
// Same as [`run_tags`](#run_tags) but defined as a singular repeatable
// block containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
RunTag hcl2template.NameValues `mapstructure:"run_tag" required:"false"`

View File

@ -57,7 +57,7 @@ type SourceMachineConfig struct {
MachineTags map[string]string `mapstructure:"source_machine_tags" required:"false"`
// Same as [`source_machine_tags`](#source_machine_tags) but defined as a
// singular block containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
MachineTag hcl2template.NameValues `mapstructure:"source_machine_tag" required:"false"`
// Whether or not the firewall

View File

@ -39,7 +39,7 @@ type TargetImageConfig struct {
ImageTags map[string]string `mapstructure:"image_tags" required:"false"`
// Same as [`image_tags`](#image_tags) but defined as a singular repeatable
// block containing a `name` and a `value` field. In HCL2 mode the
// [`dynamic_block`](https://packer.io/docs/configuration/from-1.5/expressions.html#dynamic-blocks)
// [`dynamic_block`](/docs/configuration/from-1.5/expressions#dynamic-blocks)
// will allow you to create those programatically.
ImageTag hcl2template.NameValues `mapstructure:"image_tag" required:"false"`
}

View File

@ -90,7 +90,7 @@ type Config struct {
BoxVersion string `mapstructure:"box_version" required:"false"`
// a path to a golang template for a vagrantfile. Our default template can
// be found here. The template variables available to you are
// {{ .BoxName }}, {{ .SyncedFolder }}, and {{.InsertKey}}, which
// `{{ .BoxName }}`, `{{ .SyncedFolder }}`, and `{{.InsertKey}}`, which
// correspond to the Packer options box_name, synced_folder, and insert_key.
Template string `mapstructure:"template" required:"false"`

View File

@ -39,8 +39,7 @@ type ExportConfig struct {
// packer call like this (shell `>` continuation character snipped for easier
// copy & paste):
//
// ``` {.shell}
//
// ``` shell
// vm_description='some
// multiline
// description'

View File

@ -14,7 +14,7 @@ type VBoxManageConfig struct {
// array of strings, where each string represents a single argument on the
// command-line to `VBoxManage` (but excluding `VBoxManage` itself). Each
// arg is treated as a [configuration
// template](/docs/templates/engine.html), where the `Name` variable is
// template](/docs/templates/engine), where the `Name` variable is
// replaced with the VM name. More details on how to use `VBoxManage` are
// below.
VBoxManage [][]string `mapstructure:"vboxmanage" required:"false"`

View File

@ -22,7 +22,7 @@ type ExportConfig struct {
// argument. Currently, exporting the build VM (with ovftool) is only
// supported when building on ESXi e.g. when `remote_type` is set to
// `esx5`. See the [Building on a Remote vSphere
// Hypervisor](/docs/builders/vmware-iso.html#building-on-a-remote-vsphere-hypervisor)
// Hypervisor](/docs/builders/vmware-iso#building-on-a-remote-vsphere-hypervisor)
// section below for more info.
OVFToolOptions []string `mapstructure:"ovftool_options" required:"false"`
// Defaults to `false`. When enabled, Packer will not export the VM. Useful
@ -30,7 +30,7 @@ type ExportConfig struct {
// VM. Currently, exporting the build VM is only supported when building on
// ESXi e.g. when `remote_type` is set to `esx5`. See the [Building on a
// Remote vSphere
// Hypervisor](/docs/builders/vmware-iso.html#building-on-a-remote-vsphere-hypervisor)
// Hypervisor](/docs/builders/vmware-iso#building-on-a-remote-vsphere-hypervisor)
// section below for more info.
SkipExport bool `mapstructure:"skip_export" required:"false"`
// Set this to true if you would like to keep

View File

@ -46,39 +46,39 @@ type HWConfig struct {
// * `FILE:path(,yield)` - Specifies the path to the local file to be used
// as the serial port.
//
// * `yield` (bool) - This is an optional boolean that specifies
// whether the vm should yield the cpu when polling the port. By
// default, the builder will assume this as `FALSE`.
// * `yield` (bool) - This is an optional boolean that specifies
// whether the vm should yield the cpu when polling the port. By
// default, the builder will assume this as `FALSE`.
//
// * `DEVICE:path(,yield)` - Specifies the path to the local device to be
//  used as the serial port. If `path` is empty, then default to the first
// serial port.
//
// * `yield` (bool) - This is an optional boolean that specifies
// whether the vm should yield the cpu when polling the port. By
// default, the builder will assume this as `FALSE`.
// * `yield` (bool) - This is an optional boolean that specifies
// whether the vm should yield the cpu when polling the port. By
// default, the builder will assume this as `FALSE`.
//
// * `PIPE:path,endpoint,host(,yield)` - Specifies to use the named-pipe
// "path" as a serial port. This has a few options that determine how the
// VM should use the named-pipe.
//
// * `endpoint` (string) - Chooses the type of the VM-end, which can be
// either a `client` or `server`.
// * `endpoint` (string) - Chooses the type of the VM-end, which can be
// either a `client` or `server`.
//
// * `host` (string) - Chooses the type of the host-end, which can
// be either `app` (application) or `vm` (another virtual-machine).
// * `host` (string) - Chooses the type of the host-end, which can
// be either `app` (application) or `vm` (another virtual-machine).
//
// * `yield` (bool) - This is an optional boolean that specifies
// whether the vm should yield the cpu when polling the port. By
// default, the builder will assume this as `FALSE`.
// * `yield` (bool) - This is an optional boolean that specifies
// whether the vm should yield the cpu when polling the port. By
// default, the builder will assume this as `FALSE`.
//
// * `AUTO:(yield)` - Specifies to use auto-detection to determine the
// serial port to use. This has one option to determine how the VM should
// support the serial port.
//
// * `yield` (bool) - This is an optional boolean that specifies
// whether the vm should yield the cpu when polling the port. By
// default, the builder will assume this as `FALSE`.
// * `yield` (bool) - This is an optional boolean that specifies
// whether the vm should yield the cpu when polling the port. By
// default, the builder will assume this as `FALSE`.
//
// * `NONE` - Specifies to not use a serial port. (default)
//

View File

@ -13,7 +13,7 @@ type ToolsConfig struct {
ToolsUploadFlavor string `mapstructure:"tools_upload_flavor" required:"false"`
// The path in the VM to upload the VMware tools. This only takes effect if
// `tools_upload_flavor` is non-empty. This is a [configuration
// template](/docs/templates/engine.html) that has a single valid variable:
// template](/docs/templates/engine) that has a single valid variable:
// `Flavor`, which will be the value of `tools_upload_flavor`. By default
// the upload path is set to `{{.Flavor}}.iso`. This setting is not used
// when `remote_type` is `esx5`.

View File

@ -107,7 +107,7 @@ type Config struct {
VMName string `mapstructure:"vm_name" required:"false"`
VMXDiskTemplatePath string `mapstructure:"vmx_disk_template_path"`
// Path to a [configuration template](/docs/templates/engine.html) that
// Path to a [configuration template](/docs/templates/engine) that
// defines the contents of the virtual machine VMX file for VMware. The
// engine has access to the template variables `{{ .DiskNumber }}` and
// `{{ .DiskName }}`.

View File

@ -42,7 +42,7 @@ import (
// ```
// The above configuration would create the following files:
//
// ```
// ```text
// ./output_vsphere/example-ubuntu-disk-0.vmdk
// ./output_vsphere/example-ubuntu.mf
// ./output_vsphere/example-ubuntu.ovf

View File

@ -64,18 +64,18 @@ func main() {
header := Struct{
SourcePath: sourcePath,
Name: typeSpec.Name.Name,
Filename: "_" + typeSpec.Name.Name + ".html.md",
Filename: typeSpec.Name.Name + ".mdx",
Header: typeDecl.Doc.Text(),
}
required := Struct{
SourcePath: sourcePath,
Name: typeSpec.Name.Name,
Filename: "_" + typeSpec.Name.Name + "-required.html.md",
Filename: typeSpec.Name.Name + "-required.mdx",
}
notRequired := Struct{
SourcePath: sourcePath,
Name: typeSpec.Name.Name,
Filename: "_" + typeSpec.Name.Name + "-not-required.html.md",
Filename: typeSpec.Name.Name + "-not-required.mdx",
}
for _, field := range fields {
@ -133,7 +133,7 @@ func main() {
}
}
dir := filepath.Join(packerDir, "website", "source", "partials", builderName)
dir := filepath.Join(packerDir, "website", "pages", "partials", builderName)
os.MkdirAll(dir, 0755)
for _, str := range []Struct{header, required, notRequired} {

View File

@ -50,7 +50,7 @@ func (c *VersionCommand) Run(args []string) int {
if info.Outdated {
c.Ui.Say(fmt.Sprintf(
"\nYour version of Packer is out of date! The latest version\n"+
"is %s. You can update by downloading from www.packer.io/downloads.html",
"is %s. You can update by downloading from www.packer.io/downloads",
info.Latest))
}
}

View File

@ -105,7 +105,7 @@ import (
// ]
// ```
// For more examples of various boot commands, see the sample projects from our
// [community templates page](/community-tools.html#templates).
// [community templates page](/community-tools#templates).
type BootConfig struct {
// Time to wait after sending a group of key pressses. The value of this
// should be a duration. Examples are `5s` and `1m30s` which will cause

View File

@ -18,7 +18,7 @@ import (
// is attached as the first floppy device. The summary size of the listed files
// must not exceed 1.44 MB. The supported ways to move large files into the OS
// are using `http_directory` or [the file
// provisioner](https://www.packer.io/docs/provisioners/file.html).
// provisioner](/docs/provisioners/file).
type FloppyConfig struct {
// A list of files to place onto a floppy disk that is attached when the VM
// is booted. Currently, no support exists for creating sub-directories on

View File

@ -894,7 +894,7 @@ func scpUploadFile(dst string, src io.Reader, w io.Writer, r *bufio.Reader, fi *
if _, err := io.Copy(tf, src); err != nil {
return fmt.Errorf("Error copying input data into local temporary "+
"file. Check that TEMPDIR has enough space. Please see "+
"https://www.packer.io/docs/other/environment-variables.html#tmpdir"+
"https://www.packer.io/docs/other/environment-variables#tmpdir"+
"for more info. Error: %s", err)
}

View File

@ -73,7 +73,7 @@ func (v *Variable) Value() (cty.Value, *hcl.Diagnostic) {
Severity: hcl.DiagError,
Summary: fmt.Sprintf("Unset variable %q", v.Name),
Detail: "A used variable must be set or have a default value; see " +
"https://packer.io/docs/configuration/from-1.5/syntax.html for " +
"https://packer.io/docs/configuration/from-1.5/syntax for " +
"details.",
Context: v.Range.Ptr(),
}

View File

@ -175,7 +175,7 @@ type WinRM struct {
//
// NOTE: If using an Amazon EBS builder, you can specify the interface
// WinRM connects to via
// [`ssh_interface`](https://www.packer.io/docs/builders/amazon-ebs.html#ssh_interface)
// [`ssh_interface`](/docs/builders/amazon-ebs#ssh_interface)
WinRMHost string `mapstructure:"winrm_host"`
// The WinRM port to connect to. This defaults to `5985` for plain
// unencrypted connection and `5986` for SSL when `winrm_use_ssl` is set to

View File

@ -328,7 +328,7 @@ func funcGenSed(ctx *Context) interface{} {
return func(expression string, inputString string) (string, error) {
return "", errors.New("template function `sed` is deprecated " +
"use `replace` or `replace_all` instead." +
"Documentation: https://www.packer.io/docs/templates/engine.html")
"Documentation: https://www.packer.io/docs/templates/engine")
}
}

18
website/.editorconfig Normal file
View File

@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
[{*.md,*.json}]
max_line_length = null

4
website/.eslintrc.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
...require('@hashicorp/nextjs-scripts/.eslintrc.js'),
ignorePatterns: ['public/']
}

5
website/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
node_modules
.DS_Store
.next
out
.mdx-data

View File

@ -0,0 +1,8 @@
{
"ignore": {
"marked": {
"versions": "0.8.2",
"reason": "IE breaks"
}
}
}

7
website/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM node:10.16.3-alpine
RUN apk add --update --no-cache git make g++ automake autoconf libtool nasm libpng-dev
COPY ./package.json /website/package.json
COPY ./package-lock.json /website/package-lock.json
WORKDIR /website
RUN npm install

View File

@ -1,3 +0,0 @@
source "https://rubygems.org"
gem "middleman-hashicorp", "0.3.44"

View File

@ -1,161 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
autoprefixer-rails (9.7.4)
execjs
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
builder (3.2.4)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
chunky_png (1.3.11)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
compass (1.0.3)
chunky_png (~> 1.2)
compass-core (~> 1.0.2)
compass-import-once (~> 1.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
sass (>= 3.3.13, < 3.5)
compass-core (1.0.3)
multi_json (~> 1.0)
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
erubis (2.7.0)
eventmachine (1.2.7)
execjs (2.7.0)
ffi (1.12.2)
haml (5.1.2)
temple (>= 0.8.0)
tilt
hike (1.2.3)
hooks (0.4.1)
uber (~> 0.0.14)
http_parser.rb (0.6.0)
i18n (0.7.0)
json (2.3.0)
kramdown (1.17.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
middleman (3.4.1)
coffee-script (~> 2.2)
compass (>= 1.0.0, < 2.0.0)
compass-import-once (= 1.0.5)
execjs (~> 2.0)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-core (= 3.4.1)
middleman-sprockets (>= 3.1.2)
sass (>= 3.4.0, < 4.0)
uglifier (~> 2.5)
middleman-core (3.4.1)
activesupport (~> 4.1)
bundler (~> 1.1)
capybara (~> 2.4.4)
erubis
hooks (~> 0.3)
i18n (~> 0.7.0)
listen (~> 3.0.3)
padrino-helpers (~> 0.12.3)
rack (>= 1.4.5, < 2.0)
thor (>= 0.15.2, < 2.0)
tilt (~> 1.4.1, < 2.0)
middleman-hashicorp (0.3.44)
bootstrap-sass (~> 3.3)
builder (~> 3.2)
middleman (~> 3.4)
middleman-livereload (~> 3.4)
middleman-syntax (~> 3.0)
redcarpet (~> 3.3)
turbolinks (~> 5.0)
middleman-livereload (3.4.6)
em-websocket (~> 0.5.1)
middleman-core (>= 3.3)
rack-livereload (~> 0.3.15)
middleman-sprockets (3.5.0)
middleman-core (>= 3.3)
sprockets (~> 2.12.1)
sprockets-helpers (~> 1.1.0)
sprockets-sass (~> 1.3.0)
middleman-syntax (3.2.0)
middleman-core (>= 3.2)
rouge (~> 3.2)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
mini_portile2 (2.4.0)
minitest (5.14.0)
multi_json (1.14.1)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
padrino-helpers (0.12.9)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.12.9)
tilt (>= 1.4.1, < 3)
padrino-support (0.12.9)
activesupport (>= 3.1)
rack (1.6.13)
rack-livereload (0.3.17)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.5.0)
rouge (3.16.0)
sass (3.4.25)
sassc (2.2.1)
ffi (~> 1.9)
sprockets (2.12.5)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-helpers (1.1.0)
sprockets (~> 2.0)
sprockets-sass (1.3.1)
sprockets (~> 2.0)
tilt (~> 1.1)
temple (0.8.2)
thor (1.0.1)
thread_safe (0.3.6)
tilt (1.4.1)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.6)
thread_safe (~> 0.1)
uber (0.0.15)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
xpath (2.1.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
middleman-hashicorp (= 0.3.44)
BUNDLED WITH
1.17.3

View File

@ -1,30 +1,54 @@
configure_cache:
mkdir -p tmp/cache
build: configure_cache
@echo "==> Starting build in Docker..."
@docker run \
--interactive \
--rm \
--tty \
--volume "$(shell pwd):/opt/buildhome/repo" \
--volume "$(shell pwd)/tmp/cache:/opt/buildhome/cache" \
--env "ENV=production" \
netlify/build \
build middleman build --verbose
website: configure_cache
# Default: run this if working on the website locally to run in watch mode.
website:
@echo "==> Downloading latest Docker image..."
@docker pull hashicorp/packer-website
@echo "==> Starting website in Docker..."
@docker run \
--interactive \
--rm \
--tty \
--volume "$(shell pwd):/opt/buildhome/repo" \
--volume "$(shell pwd)/tmp/cache:/opt/buildhome/cache" \
--publish "4567:4567" \
--publish "35729:35729" \
--env "ENV=production" \
netlify/build \
build middleman
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
--publish "3000:3000" \
hashicorp/packer-website \
npm start
.PHONY: build website
# This command will generate a static version of the website to the "out" folder.
build:
@echo "==> Downloading latest Docker image..."
@docker pull hashicorp/packer-website
@echo "==> Starting build in Docker..."
@docker run \
--interactive \
--rm \
--tty \
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
hashicorp/packer-website \
npm run static
# If you are changing node dependencies locally, run this to generate a new
# local Docker image with the dependency changes included.
build-image:
@echo "==> Building Docker image..."
@docker build -t hashicorp-packer-website-local .
# Use this if you have run `build-image` to use the locally built image
# rather than our CI-generated image to test dependency changes.
website-local:
@echo "==> Starting website in Docker..."
@docker run \
--interactive \
--rm \
--tty \
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
--publish "3000:3000" \
hashicorp-packer-website-local \
npm start
.DEFAULT_GOAL := website
.PHONY: build build-image website website-local

View File

@ -1,22 +1,193 @@
# Packer Website
This subdirectory contains the entire source for the [Packer Website][packer].
This is a [Middleman][middleman] project, which builds a static site from these
source files.
[![Netlify Status](https://img.shields.io/netlify/f7fa8963-0022-4a0e-9ccf-f5385355906b?style=flat-square)](https://app.netlify.com/sites/packer-docs-platform/deploys)
This subdirectory contains the entire source for the [Packer Website](https://packer.io/). This is a [NextJS](https://nextjs.org/) project, which builds a static site from these source files.
## Contributions Welcome!
If you find a typo or you feel like you can improve the HTML, CSS, or
JavaScript, we welcome contributions. Feel free to open issues or pull requests
like any normal GitHub project, and we'll merge it in.
If you find a typo or you feel like you can improve the HTML, CSS, or JavaScript, we welcome contributions. Feel free to open issues or pull requests like any normal GitHub project, and we'll merge it in 🚀
## Running the Site Locally
1. Install [Docker](https://docs.docker.com/engine/installation/) if you have not already done so
2. Clone this repo and run `make website`
The website can be run locally through node.js or Docker. If you choose to run through Docker, everything will be a little bit slower due to the additional overhead, so for frequent contributors it may be worth it to use node. Also if you are a vim user, it's also worth noting that vim's swapfile usage can cause issues for the live reload functionality. In order to avoid these issues, make sure you have run `:set backupcopy=yes` within vim.
Then open up `http://localhost:4567`. Note that some URLs you may need to append
".html" to make them work (in the navigation).
### With Docker
[middleman]: https://www.middlemanapp.com
[packer]: https://www.packer.io
Running the site locally is simple. Provided you have Docker installed, clone this repo, run `make`, and then visit `http://localhost:3000`.
The docker image is pre-built with all the website dependencies installed, which is what makes it so quick and simple, but also means if you need to change dependencies and test the changes within Docker, you'll need a new image. If this is something you need to do, you can run `make build-image` to generate a local Docker image with updated dependencies, then `make website-local` to use that image and preview.
### With Node
If your local development environment has a supported version (v10.0.0+) of [node installed](https://nodejs.org/en/) you can run:
- `npm install`
- `npm start`
and then visit `http://localhost:3000`.
If you pull down new code from github, you should run `npm install` again. Otherwise, there's no need to re-run `npm install` each time the site is run, you can just run `npm start` to get it going.
## Editing Content
Documentation content is written in [Markdown](https://www.markdownguide.org/cheat-sheet/) and you'll find all files listed under the `/pages` directory.
To create a new page with Markdown, create a file ending in `.mdx` in the `pages/` directory. The path in the pages directory will be the URL route. For example, `pages/hello/world.mdx` will be served from the `/hello/world` URL.
This file can be standard Markdown and also supports [YAML frontmatter](https://middlemanapp.com/basics/frontmatter/). YAML frontmatter is optional, there are defaults for all keys.
```yaml
---
title: 'My Title'
description: "A thorough, yet succinct description of the page's contents"
---
```
The significant keys in the YAML frontmatter are:
- `title` `(string)` - This is the title of the page that will be set in the HTML title.
- `description` `(string)` - This is a description of the page that will be set in the HTML description.
> ⚠Since `api` is a reserved directory within NextJS, all `/api/**` pages are listed under the `/pages/api-docs` path.
### Editing Sidebars
The structure of the sidebars are controlled by files in the [`/data` directory](data).
- Edit [this file](data/docs-navigation.js) to change the **docs** sidebar
- Edit [this file](data/guides-navigation.js) to change the **guides** sidebar
- Edit [this file](data/intro-navigation.js) to change the **intro** sidebar
To nest sidebar items, you'll want to add a new `category` key/value accompanied by the appropriate embedded `content` values.
- `category` values will be **directory names** within the `pages` directory
- `content` values will be **file names** within their appropriately nested directory.
### Creating New Pages
There is currently a small bug with new page creation - if you create a new page and link it up via subnav data while the server is running, it will report an error saying the page was not found. This can be resolved by restarting the server.
### Changing the Release Version
To change the version of Packer displayed for download on the website, head over to `data/version.js` and change the number there. It's important to note that the version number must match a version that has been released and is live on `releases.hashicorp.com` -- if it does not, the website will be unable to fetch links to the binaries and will not compile. So this version number should be changed _only after a release_.
#### Displaying a Prerelease
If there is a prerelease of any type that should be displayed on the downloads page, this can be done by editing `pages/downloads/index.jsx`. By default, the download component might look something like this:
```jsx
<ProductDownloader
product="Packer"
version={VERSION}
downloads={downloadData}
community="/resources"
/>
```
To add a prerelease, an extra `prerelease` property can be added to the component as such:
```jsx
<ProductDownloader
product="Packer"
version={VERSION}
downloads={downloadData}
community="/resources"
prerelease={{
type: 'release candidate', // the type of prerelease: beta, release candidate, etc.
name: 'v1.0.0', // the name displayed in text on the website
version: '1.0.0-rc1', // the actual version tag that was pushed to releases.hashicorp.com
}}
/>
```
This configuration would display something like the following text on the website, emphasis added to the configurable parameters:
```
A {{ release candidate }} for Packer {{ v1.0.0 }} is available! The release can be <a href='https://releases.hashicorp.com/packer/{{ 1.0.0-rc1 }}'>downloaded here</a>.
```
You may customize the parameters in any way you'd like. To remove a prerelease from the website, simply delete the `prerelease` paremeter from the above component.
### Markdown Enhancements
There are several custom markdown plugins that are available by default that enhance standard markdown to fit our use cases. This set of plugins introduces a couple instances of custom syntax, and a couple specific pitfalls that are not present by default with markdown, detailed below:
- If you see the symbols `~>`, `->`, `=>`, or `!>`, these represent [custom alerts](https://github.com/hashicorp/remark-plugins/tree/master/plugins/paragraph-custom-alerts#paragraph-custom-alerts). These render as colored boxes to draw the user's attention to some type of aside.
- If you see `@include '/some/path.mdx'`, this is a [markdown include](https://github.com/hashicorp/remark-plugins/tree/master/plugins/include-markdown#include-markdown-plugin). It's worth noting as well that all includes resolve from `website/pages/partials` by default.
- If you see `# Headline ((#slug))`, this is an example of an [anchor link alias](https://github.com/hashicorp/remark-plugins/tree/je.anchor-link-adjustments/plugins/anchor-links#anchor-link-aliases). It adds an extra permalink to a headline for compatibility and is removed from the output.
- Due to [automatically generated permalinks](https://github.com/hashicorp/remark-plugins/tree/je.anchor-link-adjustments/plugins/anchor-links#anchor-links), any text changes to _headlines_ or _list items that begin with inline code_ can and will break existing permalinks. Be very cautious when changing either of these two text items.
Headlines are fairly self-explanitory, but here's an example of how list items that begin with inline code look.
```markdown
- this is a normal list item
- `this` is a list item that begins with inline code
```
Its worth noting that _only the inline code at the beginning of the list item_ will cause problems if changed. So if you changed the above markup to...
```markdown
- lsdhfhksdjf
- `this` jsdhfkdsjhkdsfjh
```
...while it perhaps would not be an improved user experience, no links would break because of it. The best approach is to **avoid changing headlines and inline code at the start of a list item**. If you must change one of these items, make sure to tag someone from the digital marketing development team on your pull request, they will help to ensure as much compatibility as possible.
### Redirects
This website structures URLs based on the filesystem layout. This means that if a file is moved, removed, or a folder is re-organized, links will break. If a path change is necessary, it can be mitigated using redirects.
To add a redirect, head over to the `_redirects` file - the format is fairly simple. On the left is the current path, and on the right is the path that should be redirected to. It's important to note that if there are links to a `.html` version of a page, that must also be explicitly redirected. For example:
```
/foo /bar
/foo.html /bar
```
This redirect rule will send all incoming links to `/foo` and `/foo.html` to `/bar`. For more details on the redirects file format, [check out the docs on netlify](https://docs.netlify.com/routing/redirects/rewrites-proxies).
There are a couple important caveats with redirects. First, redirects are applied at the hosting layer, and therefore will not work by default in local dev mode. To test in local dev mode, you can use [`netlify dev`](https://www.netlify.com/products/dev/), or just push a commit and check using the deploy preview.
Second, redirects do not apply to client-side navigation. By default, all links in the navigation and docs sidebar will navigate purely on the client side, which makes navigation through the docs significantly faster, especially for those with low-end devices and/or weak internet connections. In the future, we plan to convert all internal links within docs pages to behave this way as well. This means that if there is a link on this website to a given piece of content that has changed locations in some way, we need to also _directly change existing links to the content_. This way, if a user clicks a link that navigates on the client side, or if they hit the url directly and the page renders from the server side, either one will work perfectly.
Let's look at an example. Say you have a page called `/docs/foo` which needs to be moved to `/docs/nested/foo`. Additionally, this is a page that has been around for a while and we know there are links into `/docs/foo.html` left over from our previous website structure. First, we move the page, then adjust the docs sidenav, in `data/docs-navigation.js`. Find the category the page is in, and move it into the appropriate subcategory. Next, we add to `_redirects` as such:
```
/foo /nested/foo
/foo.html /nested/foo
```
Finally, we run a global search for internal links to `/foo`, and make sure to adjust them to be `/nested/foo` - this is to ensure that client-side navigation still works correctly. _Adding a redirect alone is not enough_.
One more example - let's say that content is being moved to an external website. A common example is guides moving to `learn.hashicorp.com`. In this case, we take all the same steps, except that we need to make a different type of change to the `docs-navigation` file. If previously the structure looked like:
```js
{
category: 'docs',
content: [
'foo'
]
}
```
If we no longer want the link to be in the side nav, we can simply remove it. If we do still want the link in the side nav, but pointing to an external destnation, we need to slightly change the structure as such:
```js
{
category: 'docs',
content: [
{ title: 'Foo Title', href: 'https://learn.hashicorp.com/vault/foo' }
]
}
```
As the majority of items in the side nav are internal links, the structure makes it as easy as possible to represent these links. This alternate syntax is the most concise manner than an external link can be represented. External links can be used anywhere within the docs sidenav.
It's also worth noting that it is possible to do glob-based redirects, for example matching `/docs/*`, and you may see this pattern in the `_redirects` file. This type of redirect is much higher risk and the behavior is a bit more nuanced, so if you need to add a glob redirect, please reach out to the website maintainers and ask about it first.
### Deployment
This website is hosted on Netlify and configured to automatically deploy anytime you push code to the `stable-website` branch. Any time a pull request is submitted that changes files within the `website` folder, a deployment preview will appear in the github checks which can be used to validate the way docs changes will look live. Deployments from `stable-website` will look and behave the same way as deployment previews.

71
website/_redirects Normal file
View File

@ -0,0 +1,71 @@
# REDIRECTS FILE
#
# See https://www.netlify.com/docs/redirects/ for documentation. Please do not
# modify or delete existing redirects without first verifying internally.
/docs/installation.html /docs/install 301!
/docs/command-line/machine-readable.html /docs/commands 301!
/docs/command-line/introduction.html /docs/commands 301!
/docs/templates/introduction.html /docs/templates 301!
/docs/builders/azure-setup.html /docs/builders/azure 301!
/docs/templates/veewee-to-packer.html /guides/veewee-to-packer 301!
/docs/extend/developing-plugins.html /docs/extending/plugins 301!
/docs/extending/developing-plugins.html /docs/extending/plugins 301!
/docs/extend/builder.html /docs/extending/custom-builders 301!
/docs/getting-started/setup.html /docs/getting-started/install 301!
/docs/other/community.html /community-tools 301!
/downloads-community.html /community-tools 301!
/community/index.html /community 301!
/docs/other/environmental-variables.html /docs/other/environment-variables 301!
/docs/platforms.html /docs/builders 301!
/intro/platforms.html /docs/builders 301!
/docs/templates/configuration-templates.html /docs/templates/engine 301!
/docs/machine-readable/* /docs/commands 301!
/docs/command-line/* /docs/commands/:splat 200
/docs/extend/* /docs/extending/:splat 200
/intro/getting-started/install /intro/getting-started 301!
/intro/getting-started/install.html /intro/getting-started 301!
/docs/basics/terminology /docs/terminology 301!
/docs/basics/terminology.html /docs/terminology 301!
/docs/other/* /docs/:splat 200
/docs/configuration/from-1.5/* /docs/from-1.5/:splat 200
/docs/configuration/from-1.5/*/overview /docs/from-1.5/:splat 200
/docs/configuration/from-1.5/*/overview.html /docs/from-1.5/:splat 200
/docs/builders/amazon.html /docs/builders/amazon 301!
/docs/builders/amazon-*.html /docs/builders/amazon/:splat 200
/docs/builders/amazon-* /docs/builders/amazon/:splat 200
/docs/builders/azure.html /docs/builders/azure 301!
/docs/builders/azure-*.html /docs/builders/azure/:splat 200
/docs/builders/azure-* /docs/builders/azure/:splat 200
/docs/builders/hyperv.html /docs/builders/hyperv 301!
/docs/builders/hyperv-*.html /docs/builders/hyperv/:splat 200
/docs/builders/hyperv-* /docs/builders/hyperv/:splat 200
/docs/builders/oracle.html /docs/builders/oracle 301!
/docs/builders/oracle-*.html /docs/builders/oracle/:splat 200
/docs/builders/oracle-* /docs/builders/oracle/:splat 200
/docs/builders/outscale.html /docs/builders/outscale 301!
/docs/builders/osc-*.html /docs/builders/outscale/:splat 200
/docs/builders/osc-* /docs/builders/outscale/:splat 200
/docs/builders/parallels.html /docs/builders/parallels 301!
/docs/builders/parallels-*.html /docs/builders/parallels/:splat 200
/docs/builders/parallels-* /docs/builders/parallels/:splat 200
/docs/builders/virtualbox.html /docs/builders/virtualbox 301!
/docs/builders/virtualbox-*.html /docs/builders/virtualbox/:splat 200
/docs/builders/virtualbox-* /docs/builders/virtualbox/:splat 200
/docs/builders/vmware.html /docs/builders/vmware 301!
/docs/builders/vmware-*.html /docs/builders/vmware/:splat 200
/docs/builders/vmware-* /docs/builders/vmware/:splat 200
/docs/builders/vsphere-*.html /docs/builders/vmware/vsphere-:splat 200
/docs/builders/vsphere-* /docs/builders/vmware/vsphere-:splat 200

4
website/babel.config.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
presets: ['next/babel'],
plugins: ['import-glob-array']
}

View File

@ -0,0 +1,32 @@
import Link from 'next/link'
export default function Footer({ openConsentManager }) {
return (
<footer className="g-footer">
<div className="g-container">
<div className="left">
<Link href="/intro">
<a>Intro</a>
</Link>
<Link href="/guides">
<a>Guides</a>
</Link>
<Link href="/docs">
<a>Docs</a>
</Link>
<Link href="/community">
<a>Community</a>
</Link>
<a href="https://hashicorp.com/privacy">Privacy</a>
<Link href="/security">
<a>Security</a>
</Link>
<Link href="/files/press-kit.zip">
<a>Press Kit</a>
</Link>
<a onClick={openConsentManager}>Consent Manager</a>
</div>
</div>
</footer>
)
}

View File

@ -0,0 +1,32 @@
.g-footer {
padding: 25px 0 17px 0;
flex-shrink: 0;
display: flex;
& .g-container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
& a {
color: black;
opacity: 0.5;
transition: opacity 0.25s ease;
cursor: pointer;
display: inline-block;
&:hover {
opacity: 1;
}
}
& .left > a {
margin-right: 20px;
margin-bottom: 8px;
&:last-child {
margin-right: 0;
}
}
}

View File

@ -0,0 +1,23 @@
import Subnav from '@hashicorp/react-subnav'
import subnavItems from '../../data/subnav'
import { useRouter } from 'next/router'
export default function PackerSubnav() {
const router = useRouter()
return (
<Subnav
titleLink={{
text: 'packer',
url: '/',
}}
ctaLinks={[
{ text: 'GitHub', url: 'https://www.github.com/hashicorp/packer' },
{ text: 'Download', url: '/downloads' },
]}
currentPath={router.pathname}
menuItemsAlign="right"
menuItems={subnavItems}
constrainWidth
/>
)
}

View File

@ -1,115 +0,0 @@
set :base_url, "https://www.packer.io/"
activate :hashicorp do |h|
h.name = "packer"
h.version = "1.5.5"
h.github_slug = "hashicorp/packer"
h.website_root = "website"
end
helpers do
# Returns a segment tracking ID such that local development is not
# tracked to production systems.
def segmentId()
if (ENV['ENV'] == 'production')
'AjXdfmTTk1I9q9dfyePuDFHBrz1tCO3l'
else
'0EXTgkNx0Ydje2PGXVbRhpKKoe5wtzcE'
end
end
# Returns the FQDN of the image URL.
#
# @param [String] path
#
# @return [String]
def image_url(path)
File.join(base_url, image_path(path))
end
# Get the title for the page.
#
# @param [Middleman::Page] page
#
# @return [String]
def title_for(page)
if page && page.data.page_title
return "#{page.data.page_title} - Packer by HashiCorp"
end
"Packer by HashiCorp"
end
# Get the description for the page
#
# @param [Middleman::Page] page
#
# @return [String]
def description_for(page)
description = (page.data.description || "")
.gsub('"', '')
.gsub(/\n+/, ' ')
.squeeze(' ')
return escape_html(description)
end
# This helps by setting the "active" class for sidebar nav elements
# if the YAML frontmatter matches the expected value.
def sidebar_current(expected)
current = current_page.data.sidebar_current || ""
if current.start_with?(expected)
return " class=\"active\""
else
return ""
end
end
# Returns the id for this page.
# @return [String]
def body_id_for(page)
if !(name = page.data.sidebar_current).blank?
return "page-#{name.strip}"
end
if page.url == "/" || page.url == "/index.html"
return "page-home"
end
if !(title = page.data.page_title).blank?
return title
.downcase
.gsub('"', '')
.gsub(/[^\w]+/, '-')
.gsub(/_+/, '-')
.squeeze('-')
.squeeze(' ')
end
return ""
end
# Returns the list of classes for this page.
# @return [String]
def body_classes_for(page)
classes = []
if !(page.data.layout).blank?
classes << "layout-#{page.data.layout}"
end
if !(title = page.data.page_title).blank?
title = title
.downcase
.gsub('"', '')
.gsub(/[^\w]+/, '-')
.gsub(/_+/, '-')
.squeeze('-')
.squeeze(' ')
classes << "page-#{title}"
end
return classes.join(" ")
end
end
# Netlify redirects/headers
proxy '_redirects', 'netlify-redirects', ignore: true
proxy '_headers', 'netlify-headers', ignore: true

View File

@ -0,0 +1,277 @@
// The root folder for this documentation category is `pages/docs`
//
// - A string refers to the name of a file
// - A "category" value refers to the name of a directory
// - All directories must have an "index.mdx" file to serve as
// the landing page for the category
export default [
{
category: 'from-1.5',
content: [
'variables',
'locals',
'syntax',
'expressions',
'syntax-json',
{
category: 'functions',
content: [
{
category: 'numeric',
content: [
'abs',
'ceil',
'floor',
'log',
'max',
'min',
'parseint',
'pow',
'signum',
],
},
{
category: 'string',
content: [
'chomp',
'format',
'formatlist',
'indent',
'join',
'lower',
'replace',
'regexreplace',
'split',
'strrev',
'substr',
'title',
'trim',
'trimprefix',
'trimsuffix',
'trimspace',
'upper',
],
},
{
category: 'collection',
content: [
'chunklist',
'coalesce',
'coalescelist',
'compact',
'concat',
'contains',
'distinct',
'element',
'flatten',
'keys',
'length',
'lookup',
'merge',
'range',
'reverse',
'setintersection',
'setproduct',
'setunion',
'slice',
'sort',
'values',
'zipmap',
],
},
{
category: 'encoding',
content: [
'base64decode',
'base64encode',
'csvdecode',
'jsondecode',
'jsonencode',
'urlencode',
'yamldecode',
'yamlencode',
],
},
{
category: 'file',
content: [
'abspath',
'basename',
'dirname',
'file',
'fileexists',
'fileset',
'pathexpand',
],
},
{
category: 'datetime',
content: ['formatdate', 'timeadd', 'timestamp'],
},
{
category: 'crypto',
content: [
'bcrypt',
'md5',
'rsadecrypt',
'sha1',
'sha256',
'sha512',
],
},
{
category: 'uuid',
content: ['uuidv4', 'uuidv5'],
},
{
category: 'ipnet',
content: ['cidrhost', 'cidrnetmask', 'cidrsubnet'],
},
{
category: 'conversion',
content: ['can', 'convert', 'try'],
},
],
},
],
},
'--------',
'terminology',
{
category: 'commands',
content: ['build', 'console', 'fix', 'inspect', 'validate'],
},
{
category: 'templates',
content: [
'builders',
'communicator',
'engine',
'post-processors',
'provisioners',
'user-variables',
],
},
'----------',
{ category: 'communicators', content: ['ssh', 'winrm'] },
{
category: 'builders',
content: [
'alicloud-ecs',
{
category: 'amazon',
content: ['chroot', 'ebs', 'ebssurrogate', 'ebsvolume', 'instance'],
},
{
category: 'azure',
content: ['arm', 'chroot'],
},
'cloudstack',
'digitalocean',
'docker',
'file',
'googlecompute',
'hetzner-cloud',
'hyperone',
{ category: 'hyperv', content: ['iso', 'vmcx'] },
'linode',
'lxc',
'lxd',
'ncloud',
'null',
'oneandone',
'openstack',
{ category: 'oracle', content: ['classic', 'oci'] },
{
category: 'outscale',
content: ['chroot', 'bsu', 'bsusurrogate', 'bsuvolume'],
},
{ category: 'parallels', content: ['iso', 'pvm'] },
'profitbricks',
'proxmox',
'qemu',
'scaleway',
'tencentcloud-cvm',
'jdcloud',
'triton',
'ucloud-uhost',
'vagrant',
{
category: 'virtualbox',
content: ['iso', 'ovf', 'vm'],
},
{
category: 'vmware',
content: ['iso', 'vmx', 'vsphere-iso', 'vsphere-clone'],
},
'yandex',
'custom',
'community-supported',
],
},
{
category: 'provisioners',
content: [
'ansible-local',
'ansible',
'breakpoint',
'chef-client',
'chef-solo',
'converge',
'file',
'inspec',
'powershell',
'puppet-masterless',
'puppet-server',
'salt-masterless',
'shell',
'shell-local',
'windows-shell',
'windows-restart',
'custom',
'community-supported',
],
},
{
category: 'post-processors',
content: [
'alicloud-import',
'amazon-import',
'artifice',
'compress',
'checksum',
'digitalocean-import',
'docker-import',
'docker-push',
'docker-save',
'docker-tag',
'exoscale-import',
'googlecompute-export',
'googlecompute-import',
'manifest',
'shell-local',
'ucloud-import',
'vagrant',
'vagrant-cloud',
'vsphere',
'vsphere-template',
],
},
'----------',
'install',
'----------',
{
category: 'extending',
content: [
'plugins',
'custom-builders',
'custom-post-processors',
'custom-provisioners',
],
},
'---------',
'environment-variables',
'core-configuration',
'debugging',
]

View File

@ -1,8 +0,0 @@
required:
<config parameter>:
type: <type>
docs: <doc string>
optional:
<config parameter>:
type: <type>
docs: <doc string>

View File

@ -0,0 +1,35 @@
// The root folder for this documentation category is `pages/guides`
//
// - A string refers to the name of a file
// - A "category" value refers to the name of a directory
// - All directories must have an "index.mdx" file to serve as
// the landing page for the category
export default [
{
category: 'hcl',
content: ['from-json-v1', 'variables', 'component-object-spec']
},
{
category: 'automatic-operating-system-installs',
content: ['autounattend_windows', 'preseed_ubuntu']
},
{
category: 'workflow-tips-and-tricks',
content: [
'isotime-template-function',
'veewee-to-packer',
'use-packer-with-comment'
]
},
{
category: 'packer-on-cicd',
content: [
'build-image-in-cicd',
'build-virtualbox-image',
'upload-images-to-artifact',
'trigger-tfe'
]
}
]

View File

@ -0,0 +1,15 @@
// The root folder for this documentation category is `pages/intro`
//
// - A string refers to the name of a file
// - A "category" value refers to the name of a directory
// - All directories must have an "index.mdx" file to serve as
// the landing page for the category
export default [
'why',
'use-cases',
{
category: 'getting-started',
content: ['build-image', 'provision', 'parallel-builds', 'vagrant', 'next']
}
]

23
website/data/subnav.js Normal file
View File

@ -0,0 +1,23 @@
export default [
{ text: 'Overview', url: '/', type: 'inbound' },
{
text: 'Intro',
url: '/intro',
type: 'inbound'
},
{
text: 'Guides',
url: '/guides',
type: 'inbound'
},
{
text: 'Docs',
url: '/docs',
type: 'inbound'
},
{
text: 'Community',
url: '/community',
type: 'inbound'
}
]

1
website/data/version.js Normal file
View File

@ -0,0 +1 @@
export default '1.5.5'

View File

@ -1,67 +0,0 @@
locals {
github_parts = ["${split("/", var.github_repo)}"]
github_full = "${var.github_repo}"
github_org = "${local.github_parts[0]}"
github_repo = "${local.github_parts[1]}"
}
/*
-------------------------------------------------------------------
GitHub Resources
-------------------------------------------------------------------
*/
provider "github" {
organization = "${local.github_org}"
version = "~> 2.0.0"
}
// Configure the repository with the dynamically created Netlify key.
resource "github_repository_deploy_key" "key" {
title = "Netlify"
repository = "${local.github_repo}"
key = "${netlify_deploy_key.key.public_key}"
read_only = false
}
// Create a webhook that triggers Netlify builds on push.
resource "github_repository_webhook" "main" {
repository = "${local.github_repo}"
events = ["delete", "push", "pull_request"]
configuration {
content_type = "json"
url = "https://api.netlify.com/hooks/github"
insecure_ssl = false
}
depends_on = ["netlify_site.main"]
}
/*
-------------------------------------------------------------------
Netlify Resources
-------------------------------------------------------------------
*/
provider "netlify" {
version = "~> 0.1.0"
}
// A new, unique deploy key for this specific website
resource "netlify_deploy_key" "key" {}
resource "netlify_site" "main" {
name = "${var.name}"
custom_domain = "${var.custom_site_domain}"
repo {
repo_branch = "${var.github_branch}"
command = "cd website && bundle && middleman build --verbose"
deploy_key_id = "${netlify_deploy_key.key.id}"
dir = "website/build"
provider = "github"
repo_path = "${local.github_full}"
}
}

View File

@ -1,19 +0,0 @@
variable "name" {
default = "packer-www"
description = "Name of the website in slug format."
}
variable "github_repo" {
default = "hashicorp/packer"
description = "GitHub repository of the provider in 'org/name' format."
}
variable "github_branch" {
default = "stable-website"
description = "GitHub branch which netlify will continuously deploy."
}
variable "custom_site_domain" {
default = "packer.io"
description = "The custom domain to use for the Netlify site."
}

36
website/layouts/docs.jsx Normal file
View File

@ -0,0 +1,36 @@
import DocsPage from '@hashicorp/react-docs-page'
import order from '../data/docs-navigation.js'
import { frontMatter as data } from '../pages/docs/**/*.mdx'
import Head from 'next/head'
import Link from 'next/link'
function DocsLayoutWrapper(pageMeta) {
function DocsLayout(props) {
return (
<DocsPage
{...props}
product="packer"
head={{
is: Head,
title: `${pageMeta.page_title} | Packer by HashiCorp`,
description: pageMeta.description,
siteName: 'Packer by HashiCorp'
}}
sidenav={{
Link,
category: 'docs',
currentPage: props.path,
data,
order
}}
resourceURL={`https://github.com/hashicorp/packer/blob/master/website/pages/${pageMeta.__resourcePath}`}
/>
)
}
DocsLayout.getInitialProps = ({ asPath }) => ({ path: asPath })
return DocsLayout
}
export default DocsLayoutWrapper

View File

@ -0,0 +1,36 @@
import DocsPage from '@hashicorp/react-docs-page'
import order from '../data/guides-navigation.js'
import { frontMatter as data } from '../pages/guides/**/*.mdx'
import Head from 'next/head'
import Link from 'next/link'
function GuidesLayoutWrapper(pageMeta) {
function GuidesLayout(props) {
return (
<DocsPage
{...props}
product="packer"
head={{
is: Head,
title: `${pageMeta.page_title} | Packer by HashiCorp`,
description: pageMeta.description,
siteName: 'Packer by HashiCorp'
}}
sidenav={{
Link,
category: 'guides',
currentPage: props.path,
data,
order
}}
resourceURL={`https://github.com/hashicorp/packer/blob/master/website/pages/${pageMeta.__resourcePath}`}
/>
)
}
GuidesLayout.getInitialProps = ({ asPath }) => ({ path: asPath })
return GuidesLayout
}
export default GuidesLayoutWrapper

35
website/layouts/index.jsx Normal file
View File

@ -0,0 +1,35 @@
import DocsPage from '@hashicorp/react-docs-page'
import Head from 'next/head'
import Link from 'next/link'
function DocsLayoutWrapper(pageMeta) {
function DocsLayout(props) {
return (
<DocsPage
{...props}
product="packer"
head={{
is: Head,
title: `${pageMeta.page_title} | Packer by HashiCorp`,
description: pageMeta.description,
siteName: 'Packer by HashiCorp',
}}
sidenav={{
Link,
category: 'docs',
currentPage: props.path,
data: [],
order: [],
disableFilter: true,
}}
resourceURL={`https://github.com/hashicorp/packer/blob/master/website/pages/${pageMeta.__resourcePath}`}
/>
)
}
DocsLayout.getInitialProps = ({ asPath }) => ({ path: asPath })
return DocsLayout
}
export default DocsLayoutWrapper

36
website/layouts/intro.jsx Normal file
View File

@ -0,0 +1,36 @@
import DocsPage from '@hashicorp/react-docs-page'
import order from '../data/intro-navigation.js'
import { frontMatter as data } from '../pages/intro/**/*.mdx'
import Head from 'next/head'
import Link from 'next/link'
function IntroLayoutWrapper(pageMeta) {
function IntroLayout(props) {
return (
<DocsPage
{...props}
product="packer"
head={{
is: Head,
title: `${pageMeta.page_title} | Packer by HashiCorp`,
description: pageMeta.description,
siteName: 'Packer by HashiCorp'
}}
sidenav={{
Link,
category: 'intro',
currentPage: props.path,
data,
order
}}
resourceURL={`https://github.com/hashicorp/packer/blob/master/website/pages/${pageMeta.__resourcePath}`}
/>
)
}
IntroLayout.getInitialProps = ({ asPath }) => ({ path: asPath })
return IntroLayout
}
export default IntroLayoutWrapper

17
website/lib/bugsnag.js Normal file
View File

@ -0,0 +1,17 @@
import React from 'react'
import bugsnag from '@bugsnag/js'
import bugsnagReact from '@bugsnag/plugin-react'
const apiKey =
typeof window === 'undefined'
? 'b6c57b27a37e531a5de94f065dd98bc0'
: 'de0b822b269aa57b620efd8927e03744'
const bugsnagClient = bugsnag({
apiKey,
releaseStage: process.env.NODE_ENV || 'development',
})
bugsnagClient.use(bugsnagReact, React)
export default bugsnagClient

View File

@ -0,0 +1,76 @@
const isProd = process.env.NODE_ENV === 'production'
const segmentWriteKey = isProd
? 'AjXdfmTTk1I9q9dfyePuDFHBrz1tCO3l'
: '0EXTgkNx0Ydje2PGXVbRhpKKoe5wtzcE'
// TODO: refactor into web components
let utilityServerRoot = isProd
? 'https://util.hashicorp.com'
: 'https://hashicorp-web-util-staging.herokuapp.com'
if (process.env.UTIL_SERVER) {
utilityServerRoot = process.env.UTIL_SERVER.replace(/\/$/, '')
}
// Consent manager configuration
export default {
version: 3,
container: '#consent-manager',
companyName: 'HashiCorp',
privacyPolicyLink: '/privacy',
segmentWriteKey: segmentWriteKey,
utilServerRoot: utilityServerRoot,
segmentServices: [
{
key: 'googleanalytics',
name: 'Google Analytics',
description:
'Google Analytics is a popular service for tracking web traffic. We use this data to determine what content our users find important so that we can dedicate more resources toward it.',
category: 'Analytics',
},
{
name: 'Hotjar',
description:
'Hotjar is a service that generates heatmaps of where users click on our sites. We use this information to ensure that our site is not confusing, and simple to use and navigate.',
category: 'Analytics',
},
{
name: 'LinkedIn Insight Tag',
description:
'This small script allows us to see how effective our linkedin campaigns are by showing which users have clicked through to our site.',
category: 'Analytics',
},
{
name: 'Marketo V2',
description:
'Marketo is a marketing automation tool that allows us to segment users into different categories based off of their behaviors. We use this information to provide tailored information to users in our email campaigns.',
},
],
categories: [
{
name: 'Functional',
description:
'Functional services provide a utility to the website, such as the ability to log in, or to get live support. Disabling any of these scripts will cause that utility to be missing from the site.',
},
{
name: 'Analytics',
description:
'Analytics services keep track of page traffic and user behavior while browsing the site. We use this data internally to improve the usability and performance of the site. Disabling any of these scripts makes it more difficult for us to understand how our site is being used, and slower to improve it.',
},
{
name: 'Email Marketing',
description:
'Email Marketing services track user behavior while browsing the site. We use this data internally in our marketing efforts to provide users contextually relevant information based off of their behaviors. Disabling any of these scripts makes it more difficult for us to provide you contextually relevant information.',
},
],
additionalServices: [
{
name: 'OptinMonster',
description:
"OptinMonster is a service that we use to show a prompt to sign up for our newsletter if it's perceived that you are interested in our content.",
category: 'Functional',
body: `var om598c8e3a6e43d,om598c8e3a6e43d_poll=function(){var r=0;return function(n,l){clearInterval(r),r=setInterval(n,l)}}();!function(e,t,n){if(e.getElementById(n)){om598c8e3a6e43d_poll(function(){if(window['om_loaded']){if(!om598c8e3a6e43d){om598c8e3a6e43d=new OptinMonsterApp();return om598c8e3a6e43d.init({"s":"35109.598c8e3a6e43d","staging":0,"dev":0,"beta":0});}}},25);return;}var d=false,o=e.createElement(t);o.id=n,o.src="https://a.optnmstr.com/app/js/api.min.js",o.async=true,o.onload=o.onreadystatechange=function(){if(!d){if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"){try{d=om_loaded=true;om598c8e3a6e43d=new OptinMonsterApp();om598c8e3a6e43d.init({"s":"35109.598c8e3a6e43d","staging":0,"dev":0,"beta":0});o.onload=o.onreadystatechange=null;}catch(t){}}}};(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(o)}(document,"script","omapi-script");`,
},
],
}

18
website/netlify.toml Normal file
View File

@ -0,0 +1,18 @@
# This file sets configuration for Netlify
# ref: https://www.netlify.com/docs/netlify-toml-reference/
[build]
publish = "out"
command = "npm run static"
[context.production]
environment = { HASHI_ENV = "production", NODE_ENV = "production"}
[context.deploy-preview]
environment = { HASHI_ENV = "staging" }
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "SAMEORIGIN"

23
website/next.config.js Normal file
View File

@ -0,0 +1,23 @@
const withHashicorp = require('@hashicorp/nextjs-scripts')
const path = require('path')
module.exports = withHashicorp({
defaultLayout: true,
transpileModules: ['is-absolute-url', '@hashicorp/react-mega-nav'],
mdx: { resolveIncludes: path.join(__dirname, 'pages/partials') },
})({
experimental: {
css: true,
modern: true,
rewrites: () => [
{
source: '/api/:path*',
destination: '/api-docs/:path*',
},
],
},
exportTrailingSlash: true,
env: {
HASHI_ENV: process.env.HASHI_ENV,
},
})

18467
website/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

72
website/package.json Normal file
View File

@ -0,0 +1,72 @@
{
"name": "packer-docs",
"description": "Description of your website",
"version": "0.0.1",
"author": "HashiCorp",
"dependencies": {
"@bugsnag/js": "^6.5.2",
"@bugsnag/plugin-react": "^6.5.0",
"@hashicorp/nextjs-scripts": "^6.2.0-9",
"@hashicorp/react-alert": "^2.0.0",
"@hashicorp/react-button": "^2.1.7",
"@hashicorp/react-consent-manager": "^2.0.7",
"@hashicorp/react-content": "^3.0.0-0",
"@hashicorp/react-docs-page": "^1.0.2",
"@hashicorp/react-docs-sidenav": "^3.0.5",
"@hashicorp/react-docs-sitemap": "^1.0.0",
"@hashicorp/react-footer": "^3.1.12",
"@hashicorp/react-global-styles": "^4.1.0",
"@hashicorp/react-head": "^0.1.1",
"@hashicorp/react-hero": "^3.0.5",
"@hashicorp/react-image": "^2.0.1",
"@hashicorp/react-inline-svg": "^1.0.0",
"@hashicorp/react-mega-nav": "^4.0.1-2",
"@hashicorp/react-product-downloader": "^3.0.5",
"@hashicorp/react-section-header": "^2.0.0",
"@hashicorp/react-subnav": "^3.0.1",
"@hashicorp/react-text-and-content": "^4.0.7",
"@hashicorp/react-text-split": "^0.2.4",
"@hashicorp/react-text-split-with-code": "0.0.7",
"@hashicorp/react-text-split-with-image": "^1.2.4",
"@hashicorp/react-vertical-text-block-list": "^2.0.1",
"babel-plugin-import-glob-array": "^0.2.0",
"highlight.js": "^9.18.1",
"imagemin-mozjpeg": "^8.0.0",
"imagemin-optipng": "^7.1.0",
"imagemin-svgo": "^7.1.0",
"isomorphic-unfetch": "^3.0.0",
"marked": "^0.7.0",
"next": "9.3.4",
"nprogress": "^0.2.0",
"nuka-carousel": "^4.6.6",
"react": "^16.13.1",
"react-device-detect": "^1.11.14",
"react-dom": "^16.13.1",
"slugify": "^1.4.0",
"stringify-object": "^3.3.0"
},
"devDependencies": {
"dart-linkcheck": "^2.0.15",
"glob": "^7.1.6",
"husky": "^4.2.3",
"inquirer": "^7.1.0",
"prettier": "^2.0.2"
},
"husky": {
"hooks": {
"pre-commit": "next-hashicorp precommit"
}
},
"main": "index.js",
"scripts": {
"build": "node --max-old-space-size=2048 ./node_modules/.bin/next build",
"dynamic": "NODE_ENV=production next build && next start",
"export": "node --max-old-space-size=2048 ./node_modules/.bin/next export",
"format": "next-hashicorp format",
"generate:component": "next-hashicorp generate component",
"lint": "next-hashicorp lint",
"start": "rm -rf .next/cache/next-babel-loader/ && next dev",
"static": "npm run build && npm run export && cp _redirects out/.",
"linkcheck": "linkcheck https://packer.io"
}
}

87
website/pages/_app.js Normal file
View File

@ -0,0 +1,87 @@
import './style.css'
import App from 'next/app'
import NProgress from 'nprogress'
import Router from 'next/router'
import ProductSubnav from '../components/subnav'
import MegaNav from '@hashicorp/react-mega-nav'
import Footer from '../components/footer'
import { ConsentManager, open } from '@hashicorp/react-consent-manager'
import consentManagerConfig from '../lib/consent-manager-config'
import bugsnagClient from '../lib/bugsnag'
import Error from './_error'
import Head from 'next/head'
import HashiHead from '@hashicorp/react-head'
Router.events.on('routeChangeStart', NProgress.start)
Router.events.on('routeChangeError', NProgress.done)
Router.events.on('routeChangeComplete', (url) => {
setTimeout(() => window.analytics.page(url), 0)
NProgress.done()
})
// Bugsnag
const ErrorBoundary = bugsnagClient.getPlugin('react')
class NextApp extends App {
static async getInitialProps({ Component, ctx }) {
let pageProps = {}
if (Component.getInitialProps) {
pageProps = await Component.getInitialProps(ctx)
} else if (Component.isMDXComponent) {
// fix for https://github.com/mdx-js/mdx/issues/382
const mdxLayoutComponent = Component({}).props.originalType
if (mdxLayoutComponent.getInitialProps) {
pageProps = await mdxLayoutComponent.getInitialProps(ctx)
}
}
return { pageProps }
}
render() {
const { Component, pageProps } = this.props
return (
<ErrorBoundary FallbackComponent={Error}>
<HashiHead
is={Head}
title="Packer by HashiCorp"
siteName="Packer by HashiCorp"
description="Packer is a free and open source tool for creating golden images for multiple
platforms from a single source configuration."
image="https://www.packer.io/img/og-image.png"
stylesheet={[
{ href: '/css/nprogress.css' },
{
href:
'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap',
},
]}
icon={[{ href: '/favicon.ico' }]}
preload={[
{ href: '/fonts/klavika/medium.woff2', as: 'font' },
{ href: '/fonts/gilmer/light.woff2', as: 'font' },
{ href: '/fonts/gilmer/regular.woff2', as: 'font' },
{ href: '/fonts/gilmer/medium.woff2', as: 'font' },
{ href: '/fonts/gilmer/bold.woff2', as: 'font' },
{ href: '/fonts/metro-sans/book.woff2', as: 'font' },
{ href: '/fonts/metro-sans/regular.woff2', as: 'font' },
{ href: '/fonts/metro-sans/semi-bold.woff2', as: 'font' },
{ href: '/fonts/metro-sans/bold.woff2', as: 'font' },
{ href: '/fonts/dejavu/mono.woff2', as: 'font' },
]}
/>
<MegaNav product="Packer" />
<ProductSubnav />
<div className="content">
<Component {...pageProps} />
</div>
<Footer openConsentManager={open} />
<ConsentManager {...consentManagerConfig} />
</ErrorBoundary>
)
}
}
export default NextApp

View File

@ -0,0 +1,27 @@
import Document, { Head, Main, NextScript } from 'next/document'
import HashiHead from '@hashicorp/react-head'
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
return { ...initialProps }
}
render() {
return (
<html>
<HashiHead is={Head} />
<body>
<Main />
<NextScript />
<script
noModule
dangerouslySetInnerHTML={{
__html: `window.MSInputMethodContext && document.documentMode && document.write('<script src="/ie-custom-properties.js"><\\x2fscript>');`
}}
/>
</body>
</html>
)
}
}

13
website/pages/_error.jsx Normal file
View File

@ -0,0 +1,13 @@
import React from 'react'
import ErrorPage from 'next/error'
import bugsnagClient from '../lib/bugsnag'
export default class Page extends React.Component {
static async getInitialProps(ctx) {
if (ctx.err) bugsnagClient.notify(ctx.err)
return ErrorPage.getInitialProps(ctx)
}
render() {
return <ErrorPage statusCode={this.props.statusCode || '¯\\_(ツ)_/¯'} />
}
}

View File

@ -1,9 +1,7 @@
---
layout: "community"
page_title: "Community vs HashiCorp Maintained Plugins"
sidebar_current: "community-or-hashicorp-plugins"
description: |-
Packer maintains these core plugins.
layout: index
page_title: Community vs HashiCorp Maintained Plugins
description: Packer maintains these core plugins.
---
# HashiCorp Maintained Plugins

View File

@ -1,7 +1,6 @@
---
layout: "community"
page_title: "Download Packer Community Projects"
sidebar_current: "community-tools"
layout: index
page_title: Download Packer Community Projects
description: |-
Packer has a vibrant community of contributors who have built a number of
great tools on top of Packer. There are also quite a few projects
@ -21,15 +20,15 @@ vendors. These plugins are not officially tested nor officially maintained by
HashiCorp, and are listed here in order to help users find them easily.
To learn more about how to use community plugins, or how to build your own,
check out the docs on [extending Packer](/docs/extending/plugins.html)
check out the docs on [extending Packer](/docs/extending/plugins)
If you have built a plugin and would like to add it to this community list,
please make a pull request to the website so that we can document your
contribution here!
<%= partial "partials/builders/community_builders" %>
@include "builders/community_builders.mdx"
<%= partial "partials/provisioners/community_provisioners" %>
@include "provisioners/community_provisioners.mdx"
## Templates
@ -52,10 +51,10 @@ contribution here!
- [cbednarski/packer-ubuntu](https://github.com/cbednarski/packer-ubuntu) -
Ubuntu LTS Virtual Machines for Vagrant
* [geerlingguy/packer-ubuntu-1604](https://github.com/geerlingguy/packer-ubuntu-1604)
- [geerlingguy/packer-ubuntu-1604](https://github.com/geerlingguy/packer-ubuntu-1604)
\- Ubuntu 16.04 minimal Vagrant Box using Ansible provisioner
* [jakobadam/packer-qemu-templates](https://github.com/jakobadam/packer-qemu-templates)
- [jakobadam/packer-qemu-templates](https://github.com/jakobadam/packer-qemu-templates)
\- QEMU templates for various operating systems
* [lucidone/baseliner](https://git.sr.ht/~lucidone/baseliner) - Example of using
@ -64,11 +63,8 @@ contribution here!
## Wrappers
- [packer-config](https://github.com/ianchesal/packer-config) - a Ruby model that lets you build Packer configurations in Ruby
- [racker](https://github.com/aspring/racker) - an opinionated Ruby DSL for generating Packer templates
- [packerlicious](https://github.com/mayn/packerlicious) - a python library for generating Packer templates
- [packer.py](https://github.com/mayn/packer.py) - a python library for executing Packer CLI commands
## Other

View File

@ -0,0 +1,51 @@
import VerticalTextBlockList from '@hashicorp/react-vertical-text-block-list'
import SectionHeader from '@hashicorp/react-section-header'
import Head from 'next/head'
export default function CommunityPage() {
return (
<div id="p-community">
<Head>
<title key="title">Community | Packer by HashiCorp</title>
</Head>
<SectionHeader
headline="Community"
description="Packer is an open source project with a growing community. There are active, dedicated users willing to help you through various mediums."
use_h1={true}
/>
<VerticalTextBlockList
data={[
{
header: 'IRC',
body: '`#packer-tool` on Freenode',
},
{
header: 'Announcement List',
body:
'[HashiCorp Announcement Google Group](https://groups.google.com/group/hashicorp-announce)',
},
{
header: 'Discussion List',
body:
'[Packer Google Group](https://groups.google.com/group/packer-tool)',
},
{
header: 'Community Forum',
body:
'[Packer Community Forum](https://discuss.hashicorp.com/c/packer)',
},
{
header: 'Bug Tracker',
body:
'[Issue tracker on GitHub](https://github.com/hashicorp/packer/issues). Please only use this for reporting bugs. Do not ask for general help here. Use IRC or the mailing list for that.',
},
{
header: 'Training',
body:
'Paid [HashiCorp training courses](https://www.hashicorp.com/training) are also available in a city near you. Private training courses are also available.',
},
]}
/>
</div>
)
}

View File

@ -0,0 +1,8 @@
#p-community {
max-width: var(--site-max-width);
margin: 72px auto;
& .g-section-header {
margin-bottom: 100px;
}
}

View File

@ -0,0 +1,93 @@
---
description: |
The `alicloud-ecs` Packer builder plugin provide the capability to build
customized images based on an existing base images.
layout: docs
page_title: Alicloud Image Builder
sidebar_title: Alicloud ECS
---
# Alicloud Image Builder
Type: `alicloud-ecs`
The `alicloud-ecs` Packer builder plugin provide the capability to build
customized images based on an existing base images.
## Configuration Reference
The following configuration options are available for building Alicloud images.
In addition to the options listed here, a
[communicator](/docs/templates/communicator) can be configured for this
builder.
### Required:
@include 'builder/alicloud/ecs/RunConfig-required.mdx'
@include 'builder/alicloud/ecs/AlicloudImageConfig-required.mdx'
### Optional:
@include 'builder/alicloud/ecs/AlicloudAccessConfig-not-required.mdx'
@include 'builder/alicloud/ecs/AlicloudDiskDevice-not-required.mdx'
@include 'builder/alicloud/ecs/AlicloudDiskDevices-not-required.mdx'
@include 'builder/alicloud/ecs/RunConfig-not-required.mdx'
@include 'builder/alicloud/ecs/AlicloudImageConfig-not-required.mdx'
- `temporary_key_pair_name` (string) - The name of the temporary key pair to
generate. By default, Packer generates a name that looks like
`packer_<UUID>`, where &lt;UUID&gt; is a 36 character unique identifier.
## Basic Example
Here is a basic example for Alicloud.
```json
{
"variables": {
"access_key": "{{env `ALICLOUD_ACCESS_KEY`}}",
"secret_key": "{{env `ALICLOUD_SECRET_KEY`}}"
},
"builders": [
{
"type": "alicloud-ecs",
"access_key": "{{user `access_key`}}",
"secret_key": "{{user `secret_key`}}",
"region": "cn-beijing",
"image_name": "packer_test2",
"source_image": "centos_7_04_64_20G_alibase_201701015.vhd",
"ssh_username": "root",
"instance_type": "ecs.n1.tiny",
"io_optimized": "true",
"internet_charge_type": "PayByTraffic",
"image_force_delete": "true"
}
],
"provisioners": [
{
"type": "shell",
"inline": ["sleep 30", "yum install redis.x86_64 -y"]
}
]
}
```
~> Note: Images can become deprecated after a while; run
`aliyun ecs DescribeImages` to find one that exists.
~> Note: Since WinRM is closed by default in the system image. If you are
planning to use Windows as the base image, you need enable it by userdata in
order to connect to the instance, check
[alicloud_windows.json](https://github.com/hashicorp/packer/tree/master/examples/alicloud/basic/alicloud_windows.json)
and
[winrm_enable_userdata.ps1](https://github.com/hashicorp/packer/tree/master/examples/alicloud/basic/winrm_enable_userdata.ps1)
for details.
See the
[examples/alicloud](https://github.com/hashicorp/packer/tree/master/examples/alicloud)
folder in the packer project for more examples.

View File

@ -1,12 +1,16 @@
---
description: |
The amazon-chroot Packer builder is able to create Amazon AMIs backed by an EBS
volume as the root device. For more information on the difference between
instance storage and EBS-backed instances, storage for the root device section
in the EC2 documentation.
description: >
The amazon-chroot Packer builder is able to create Amazon AMIs backed by an
EBS
volume as the root device. For more information on the difference between
instance storage and EBS-backed instances, storage for the root device section
in the EC2 documentation.
layout: docs
page_title: 'Amazon chroot - Builders'
sidebar_current: 'docs-builders-amazon-chroot'
page_title: Amazon chroot - Builders
sidebar_title: chroot
---
# AMI Builder (chroot)
@ -24,11 +28,11 @@ builder is able to build an EBS-backed AMI without launching a new EC2
instance. This can dramatically speed up AMI builds for organizations who need
the extra fast build.
\~&gt; **This is an advanced builder** If you're just getting started with
~> **This is an advanced builder** If you're just getting started with
Packer, we recommend starting with the [amazon-ebs
builder](/docs/builders/amazon-ebs.html), which is much easier to use.
builder](/docs/builders/amazon-ebs), which is much easier to use.
The builder does *not* manage AMIs. Once it creates an AMI and stores it in
The builder does _not_ manage AMIs. Once it creates an AMI and stores it in
your account, it is up to you to use, delete, etc., the AMI.
### How Does it Work?
@ -60,10 +64,11 @@ necessary for this build to succeed and can be found further down the page.
#### Required:
<%= partial "partials/builder/amazon/chroot/Config-required" %>
@include 'builder/amazon/chroot/Config-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/chroot/Config-not-required" %>
@include 'builder/amazon/chroot/Config-not-required.mdx'
## General Common Configuration Reference
@ -74,31 +79,32 @@ builders.
#### Required:
<%= partial "partials/builder/amazon/common/AMIConfig-required" %>
@include 'builder/amazon/common/AMIConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/AMIConfig-not-required" %>
@include 'builder/amazon/common/AMIConfig-not-required.mdx'
### Block Devices Configuration
Block devices can be nested in the
[ami_block_device_mappings](#ami_block_device_mappings) array.
<%= partial "partials/builder/amazon/common/BlockDevice" %>
@include 'builder/amazon/common/BlockDevice.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/BlockDevice-not-required" %>
@include 'builder/amazon/common/BlockDevice-not-required.mdx'
### Access Config Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AccessConfig-required" %>
@include 'builder/amazon/common/AccessConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/AccessConfig-not-required" %>
@include 'builder/amazon/common/AccessConfig-not-required.mdx'
## Basic Example
@ -120,11 +126,11 @@ The `chroot_mounts` configuration can be used to mount specific devices within
the chroot. By default, the following additional mounts are added into the
chroot by Packer:
- `/proc` (proc)
- `/sys` (sysfs)
- `/dev` (bind to real `/dev`)
- `/dev/pts` (devpts)
- `/proc/sys/fs/binfmt_misc` (binfmt\_misc)
- `/proc` (proc)
- `/sys` (sysfs)
- `/dev` (bind to real `/dev`)
- `/dev/pts` (devpts)
- `/proc/sys/fs/binfmt_misc` (binfmt_misc)
These default mounts are usually good enough for anyone and are sane defaults.
However, if you want to change or add the mount points, you may using the
@ -143,16 +149,16 @@ mounts `/proc` and `/dev`:
`chroot_mounts` is a list of a 3-tuples of strings. The three components of the
3-tuple, in order, are:
- The filesystem type. If this is "bind", then Packer will properly bind the
filesystem to another mount point.
- The filesystem type. If this is "bind", then Packer will properly bind the
filesystem to another mount point.
- The source device.
- The source device.
- The mount directory.
- The mount directory.
## Parallelism
A quick note on parallelism: it is perfectly safe to run multiple *separate*
A quick note on parallelism: it is perfectly safe to run multiple _separate_
Packer processes with the `amazon-chroot` builder on the same EC2 instance. In
fact, this is recommended as a way to push the most performance out of your AMI
builds.
@ -174,7 +180,7 @@ file which will prevent packages installed by your provisioners from starting
services:
```json
{
({
"type": "shell",
"inline": [
"echo '#!/bin/sh' > /usr/sbin/policy-rc.d",
@ -182,15 +188,12 @@ services:
"chmod a+x /usr/sbin/policy-rc.d"
]
},
// ...
{
"type": "shell",
"inline": [
"rm -f /usr/sbin/policy-rc.d"
]
}
"inline": ["rm -f /usr/sbin/policy-rc.d"]
})
```
### Ansible provisioner
@ -211,7 +214,7 @@ A working example for mounting an NVMe device is below:
```json
{
"variables": {
"region" : "us-east-2"
"region": "us-east-2"
},
"builders": [
{
@ -219,9 +222,9 @@ A working example for mounting an NVMe device is below:
"region": "{{user `region`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "amzn-ami-hvm-*",
"root-device-type": "ebs"
"virtualization-type": "hvm",
"name": "amzn-ami-hvm-*",
"root-device-type": "ebs"
},
"owners": ["137112412989"],
"most_recent": true
@ -282,24 +285,24 @@ provisioning commands to install the os and bootloader.
In configuration directives marked as a template engine above, the following
variables are available:
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
## Build function template engine variables
For the build function of [template engine](/docs/templates/engine.html), the following
For the build function of [template engine](/docs/templates/engine), the following
variables are available:
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `Device` - Root device path.
- `MountPath` - Device mounting path.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `Device` - Root device path.
- `MountPath` - Device mounting path.

View File

@ -1,12 +1,12 @@
---
description: |
The amazon-ebs Packer builder is able to create Amazon AMIs backed by EBS
volumes for use in EC2. For more information on the difference between
EBS-backed instances and instance-store backed instances, see the storage for
the root device section in the EC2 documentation.
The amazon-ebs Packer builder is able to create Amazon AMIs backed by EBS
volumes for use in EC2. For more information on the difference between
EBS-backed instances and instance-store backed instances, see the storage for
the root device section in the EC2 documentation.
layout: docs
page_title: 'Amazon EBS - Builders'
sidebar_current: 'docs-builders-amazon-ebsbacked'
page_title: Amazon EBS - Builders
sidebar_title: EBS
---
# AMI Builder (EBS backed)
@ -26,10 +26,10 @@ keypairs, security group rules, etc. that provide it temporary access to the
instance while the image is being created. This simplifies configuration quite
a bit.
The builder does *not* manage AMIs. Once it creates an AMI and stores it in
The builder does _not_ manage AMIs. Once it creates an AMI and stores it in
your account, it is up to you to use, delete, etc. the AMI.
-&gt; **Note:** Temporary resources are, by default, all created with the
-> **Note:** Temporary resources are, by default, all created with the
prefix `packer`. This can be useful if you want to restrict the security groups
and key pairs Packer is able to operate on.
@ -47,38 +47,37 @@ necessary for this build to succeed and can be found further down the page.
#### Optional:
<%= partial "partials/builder/amazon/ebs/Config-not-required" %>
@include 'builder/amazon/ebs/Config-not-required.mdx'
### AMI Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AMIConfig-required" %>
@include 'builder/amazon/common/AMIConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/AMIConfig-not-required" %>
@include 'builder/amazon/common/AMIConfig-not-required.mdx'
### Access Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AccessConfig-required" %>
@include 'builder/amazon/common/AccessConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/AccessConfig-not-required" %>
@include 'builder/amazon/common/AccessConfig-not-required.mdx'
### Run Configuration
#### Required:
<%= partial "partials/builder/amazon/common/RunConfig-required" %>
@include 'builder/amazon/common/RunConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/RunConfig-not-required" %>
@include 'builder/amazon/common/RunConfig-not-required.mdx'
### Block Devices Configuration
@ -86,18 +85,19 @@ Block devices can be nested in the
[ami_block_device_mappings](#ami_block_device_mappings) or the
[launch_block_device_mappings](#launch_block_device_mappings) array.
<%= partial "partials/builder/amazon/common/BlockDevice" %>
@include 'builder/amazon/common/BlockDevice.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/BlockDevice-not-required" %>
@include 'builder/amazon/common/BlockDevice-not-required.mdx'
### Communicator Configuration
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %>
@include 'helper/communicator/Config-not-required.mdx'
@include 'helper/communicator/SSH-not-required.mdx'
## Basic Example
@ -126,7 +126,7 @@ run:
}
```
-&gt; **Note:** Packer can also read the access key and secret access key from
-> **Note:** Packer can also read the access key and secret access key from
environmental variables. See the configuration reference in the section above
for more information on what environmental variables Packer will look for.
@ -187,25 +187,25 @@ configuration of `launch_block_device_mappings` will expand the root volume
In configuration directives marked as a template engine above, the following
variables are available:
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
## Build function template engine variables
For the build function of [template engine](/docs/templates/engine.html), the following
For the build function of [template engine](/docs/templates/engine), the following
variables are available:
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
## Tag Example
@ -233,7 +233,7 @@ what images exist when this template is run:
}
```
-&gt; **Note:** Packer uses pre-built AMIs as the source for building images.
-> **Note:** Packer uses pre-built AMIs as the source for building images.
These source AMIs may include volumes that are not flagged to be destroyed on
termination of the instance building the new image. Packer will attempt to
clean up all residual volumes that are not designated by the user to remain
@ -342,14 +342,12 @@ be easily added to the provisioner section.
```json
{
"type": "powershell",
"inline": [
"C:/ProgramData/Amazon/EC2-Windows/Launch/Scripts/InitializeInstance.ps1 -Schedule",
"C:/ProgramData/Amazon/EC2-Windows/Launch/Scripts/SysprepInstance.ps1 -NoShutdown"
]
"type": "powershell",
"inline": [
"C:/ProgramData/Amazon/EC2-Windows/Launch/Scripts/InitializeInstance.ps1 -Schedule",
"C:/ProgramData/Amazon/EC2-Windows/Launch/Scripts/SysprepInstance.ps1 -NoShutdown"
]
}
```
<%= partial "partials/builders/aws-ssh-differentiation-table" %>
@include 'builders/aws-ssh-differentiation-table.mdx'

View File

@ -1,10 +1,12 @@
---
description: |
The amazon-ebssurrogate Packer builder is like the chroot builder, but does not
require running inside an EC2 instance.
description: >
The amazon-ebssurrogate Packer builder is like the chroot builder, but does
not
require running inside an EC2 instance.
layout: docs
page_title: 'Amazon EBS Surrogate - Builders'
sidebar_current: 'docs-builders-amazon-ebssurrogate'
page_title: Amazon EBS Surrogate - Builders
sidebar_title: EBS Surrogate
---
# EBS Surrogate Builder
@ -37,97 +39,95 @@ necessary for this build to succeed and can be found further down the page.
### Required:
<%= partial "partials/builder/amazon/ebssurrogate/Config-required" %>
@include 'builder/amazon/ebssurrogate/Config-required.mdx'
### Optional:
<%= partial "partials/builder/amazon/ebssurrogate/Config-not-required" %>
@include 'builder/amazon/ebssurrogate/Config-not-required.mdx'
### AMI Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AMIConfig-required" %>
@include 'builder/amazon/common/AMIConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/AMIConfig-not-required" %>
@include 'builder/amazon/common/AMIConfig-not-required.mdx'
### Access Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AccessConfig-required" %>
@include 'builder/amazon/common/AccessConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/AccessConfig-not-required" %>
@include 'builder/amazon/common/AccessConfig-not-required.mdx'
### Run Configuration
#### Required:
<%= partial "partials/builder/amazon/common/RunConfig-required" %>
@include 'builder/amazon/common/RunConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/RunConfig-not-required" %>
@include 'builder/amazon/common/RunConfig-not-required.mdx'
### Block Devices Configuration
Block devices can be nested in the
[ami_block_device_mappings](#ami_block_device_mappings) array.
<%= partial "partials/builder/amazon/common/BlockDevice" %>
@include 'builder/amazon/common/BlockDevice.mdx'
#### Optional only for [launch_block_device_mappings](#launch_block_device_mappings)
<%= partial "partials/builder/amazon/ebssurrogate/BlockDevice-not-required" %>
@include 'builder/amazon/ebssurrogate/BlockDevice-not-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/BlockDevice-not-required" %>
@include 'builder/amazon/common/BlockDevice-not-required.mdx'
### Communicator Configuration
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %>
@include 'helper/communicator/Config-not-required.mdx'
@include 'helper/communicator/SSH-not-required.mdx'
## Basic Example
```json
{
"type" : "amazon-ebssurrogate",
"secret_key" : "YOUR SECRET KEY HERE",
"access_key" : "YOUR KEY HERE",
"region" : "us-east-1",
"ssh_username" : "ubuntu",
"instance_type" : "t2.medium",
"source_ami" : "ami-40d28157",
"launch_block_device_mappings" : [
{
"volume_type" : "gp2",
"device_name" : "/dev/xvdf",
"delete_on_termination" : false,
"volume_size" : 10
}
],
"ami_root_device": {
"source_device_name": "/dev/xvdf",
"device_name": "/dev/xvda",
"delete_on_termination": true,
"volume_size": 16,
"volume_type": "gp2"
}
"type": "amazon-ebssurrogate",
"secret_key": "YOUR SECRET KEY HERE",
"access_key": "YOUR KEY HERE",
"region": "us-east-1",
"ssh_username": "ubuntu",
"instance_type": "t2.medium",
"source_ami": "ami-40d28157",
"launch_block_device_mappings": [
{
"volume_type": "gp2",
"device_name": "/dev/xvdf",
"delete_on_termination": false,
"volume_size": 10
}
],
"ami_root_device": {
"source_device_name": "/dev/xvdf",
"device_name": "/dev/xvda",
"delete_on_termination": true,
"volume_size": 16,
"volume_type": "gp2"
}
}
```
-&gt; **Note:** Packer can also read the access key and secret access key from
-> **Note:** Packer can also read the access key and secret access key from
environmental variables. See the configuration reference in the section above
for more information on what environmental variables Packer will look for.
@ -149,31 +149,30 @@ You can use this information to access the instance as it is running.
In configuration directives marked as a template engine above, the following
variables are available:
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
## Build function template engine variables
For the build function of [template engine](/docs/templates/engine.html), the following
For the build function of [template engine](/docs/templates/engine), the following
variables are available:
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
-&gt; **Note:** Packer uses pre-built AMIs as the source for building images.
-> **Note:** Packer uses pre-built AMIs as the source for building images.
These source AMIs may include volumes that are not flagged to be destroyed on
termination of the instance building the new image. In addition to those
volumes created by this builder, any volumes in the source AMI which are not
marked for deletion on termination will remain in your account.
<%= partial "partials/builders/aws-ssh-differentiation-table" %>
@include 'builders/aws-ssh-differentiation-table.mdx'

View File

@ -0,0 +1,199 @@
---
description: |
The amazon-ebsvolume Packer builder is like the EBS builder, but is
intended to create EBS volumes rather than a machine image.
layout: docs
page_title: Amazon EBS Volume - Builders
sidebar_title: EBS Volume
---
# EBS Volume Builder
Type: `amazon-ebsvolume`
The `amazon-ebsvolume` Packer builder is able to create Amazon Elastic Block
Store volumes which are prepopulated with filesystems or data.
This builder creates EBS volumes by launching an EC2 instance from a source
AMI. One or more EBS volumes are attached to the running instance, allowing
them to be provisioned into from the running machine. Once provisioning is
complete the source machine is destroyed. The provisioned volumes are kept
intact.
This is all done in your own AWS account. The builder will create temporary key
pairs, security group rules, etc. that provide it temporary access to the
instance while the image is being created.
The builder does _not_ manage EBS Volumes. Once it creates volumes and stores
it in your account, it is up to you to use, delete, etc. the volumes.
-> **Note:** Temporary resources are, by default, all created with the
prefix `packer`. This can be useful if you want to restrict the security groups
and key pairs Packer is able to operate on.
## Configuration Reference
There are many configuration options available for the builder. In addition to
the items listed here, you will want to look at the general configuration
references for [AMI](#ami-configuration),
[BlockDevices](#block-devices-configuration),
[Access](#access-configuration),
[Run](#run-configuration) and
[Communicator](#communicator-configuration)
configuration references, which are
necessary for this build to succeed and can be found further down the page.
### Optional:
@include 'builder/amazon/ebsvolume/Config-not-required.mdx'
### Access Configuration
#### Required:
@include 'builder/amazon/common/AccessConfig-required.mdx'
#### Optional:
@include 'builder/amazon/common/AccessConfig-not-required.mdx'
### AMI Configuration
#### Optional:
- `snapshot_groups` (array of strings) - A list of groups that have access to
create volumes from the snapshot(s). By default no groups have permission
to create volumes from the snapshot(s). `all` will make the snapshot
publicly accessible.
- `snapshot_users` (array of strings) - A list of account IDs that have
access to create volumes from the snapshot(s). By default no additional
users other than the user creating the AMI has permissions to create
volumes from the backing snapshot(s).
### Block Devices Configuration
Block devices can be nested in the
[ebs_volumes](#ebs_volumes) array.
@include 'builder/amazon/common/BlockDevice.mdx'
#### Optional:
@include 'builder/amazon/common/BlockDevice-not-required.mdx'
@include 'builder/amazon/ebsvolume/BlockDevice-not-required.mdx'
### Run Configuration
#### Required:
@include 'builder/amazon/common/RunConfig-required.mdx'
#### Optional:
@include 'builder/amazon/common/RunConfig-not-required.mdx'
### Communicator Configuration
#### Optional:
@include 'helper/communicator/Config-not-required.mdx'
@include 'helper/communicator/SSH-not-required.mdx'
## Basic Example
```json
{
"type": "amazon-ebsvolume",
"secret_key": "YOUR SECRET KEY HERE",
"access_key": "YOUR KEY HERE",
"region": "us-east-1",
"ssh_username": "ubuntu",
"instance_type": "t2.medium",
"source_ami": "ami-40d28157",
"ebs_volumes": [
{
"volume_type": "gp2",
"device_name": "/dev/xvdf",
"delete_on_termination": false,
"tags": {
"zpool": "data",
"Name": "Data1"
},
"volume_size": 10
},
{
"volume_type": "gp2",
"device_name": "/dev/xvdg",
"tags": {
"zpool": "data",
"Name": "Data2"
},
"delete_on_termination": false,
"volume_size": 10
},
{
"volume_size": 10,
"tags": {
"Name": "Data3",
"zpool": "data"
},
"delete_on_termination": false,
"device_name": "/dev/xvdh",
"volume_type": "gp2"
}
]
}
```
-> **Note:** Packer can also read the access key and secret access key from
environmental variables. See the configuration reference in the section above
for more information on what environmental variables Packer will look for.
Further information on locating AMI IDs and their relationship to instance
types and regions can be found in the AWS EC2 Documentation [for
Linux](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html)
or [for
Windows](http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/finding-an-ami.html).
## Accessing the Instance to Debug
If you need to access the instance to debug for some reason, run the builder
with the `-debug` flag. In debug mode, the Amazon builder will save the private
key in the current directory and will output the DNS or IP information as well.
You can use this information to access the instance as it is running.
## Build template data
In configuration directives marked as a template engine above, the following
variables are available:
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
-> **Note:** Packer uses pre-built AMIs as the source for building images.
These source AMIs may include volumes that are not flagged to be destroyed on
termination of the instance building the new image. In addition to those
volumes created by this builder, any volumes in the source AMI which are not
marked for deletion on termination will remain in your account.
## Build function template engine variables
For the build function of [template engine](/docs/templates/engine), the following
variables are available:
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
@include 'builders/aws-ssh-differentiation-table.mdx'

View File

@ -1,10 +1,10 @@
---
description: |
Packer is able to create Amazon AMIs. To achieve this, Packer comes with
multiple builders depending on the strategy you want to use to build the AMI.
Packer is able to create Amazon AMIs. To achieve this, Packer comes with
multiple builders depending on the strategy you want to use to build the AMI.
layout: docs
page_title: 'Amazon AMI - Builders'
sidebar_current: 'docs-builders-amazon'
page_title: Amazon AMI - Builders
sidebar_title: Amazon EC2
---
# Amazon AMI Builder
@ -13,29 +13,29 @@ Packer is able to create Amazon AMIs. To achieve this, Packer comes with
multiple builders depending on the strategy you want to use to build the AMI.
Packer supports the following builders at the moment:
- [amazon-ebs](/docs/builders/amazon-ebs.html) - Create EBS-backed AMIs by
launching a source AMI and re-packaging it into a new AMI after
provisioning. If in doubt, use this builder, which is the easiest to get
started with.
- [amazon-ebs](/docs/builders/amazon-ebs) - Create EBS-backed AMIs by
launching a source AMI and re-packaging it into a new AMI after
provisioning. If in doubt, use this builder, which is the easiest to get
started with.
- [amazon-instance](/docs/builders/amazon-instance.html) - Create
instance-store AMIs by launching and provisioning a source instance, then
rebundling it and uploading it to S3.
- [amazon-instance](/docs/builders/amazon-instance) - Create
instance-store AMIs by launching and provisioning a source instance, then
rebundling it and uploading it to S3.
- [amazon-chroot](/docs/builders/amazon-chroot.html) - Create EBS-backed AMIs
from an existing EC2 instance by mounting the root device and using a
[Chroot](https://en.wikipedia.org/wiki/Chroot) environment to provision
that device. This is an **advanced builder and should not be used by
newcomers**. However, it is also the fastest way to build an EBS-backed AMI
since no new EC2 instance needs to be launched.
- [amazon-chroot](/docs/builders/amazon-chroot) - Create EBS-backed AMIs
from an existing EC2 instance by mounting the root device and using a
[Chroot](https://en.wikipedia.org/wiki/Chroot) environment to provision
that device. This is an **advanced builder and should not be used by
newcomers**. However, it is also the fastest way to build an EBS-backed AMI
since no new EC2 instance needs to be launched.
- [amazon-ebssurrogate](/docs/builders/amazon-ebssurrogate.html) - Create EBS
-backed AMIs from scratch. Works similarly to the `chroot` builder but does
not require running in AWS. This is an **advanced builder and should not be
used by newcomers**.
- [amazon-ebssurrogate](/docs/builders/amazon-ebssurrogate) - Create EBS
-backed AMIs from scratch. Works similarly to the `chroot` builder but does
not require running in AWS. This is an **advanced builder and should not be
used by newcomers**.
-&gt; **Don't know which builder to use?** If in doubt, use the [amazon-ebs
builder](/docs/builders/amazon-ebs.html). It is much easier to use and Amazon
-> **Don't know which builder to use?** If in doubt, use the [amazon-ebs
builder](/docs/builders/amazon-ebs). It is much easier to use and Amazon
generally recommends EBS-backed images nowadays.
# Amazon EBS Volume Builder
@ -43,9 +43,11 @@ generally recommends EBS-backed images nowadays.
Packer is able to create Amazon EBS Volumes which are preinitialized with a
filesystem and data.
- [amazon-ebsvolume](/docs/builders/amazon-ebsvolume.html) - Create EBS
volumes by launching a source AMI with block devices mapped. Provision the
instance, then destroy it, retaining the EBS volumes.
- [amazon-ebsvolume](/docs/builders/amazon-ebsvolume) - Create EBS
volumes by launching a source AMI with block devices mapped. Provision the
instance, then destroy it, retaining the EBS volumes.
<!-- TODO: fix -->
<span id="specifying-amazon-credentials"></span>
@ -55,10 +57,10 @@ The AWS provider offers a flexible means of providing credentials for
authentication. The following methods are supported, in this order, and
explained below:
- Static credentials
- Environment variables
- Shared credentials file
- EC2 Role
- Static credentials
- Environment variables
- Shared credentials file
- EC2 Role
### Static Credentials
@ -67,10 +69,10 @@ These look like:
```json
{
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"region": "us-east-1",
"type": "amazon-ebs"
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"region": "us-east-1",
"type": "amazon-ebs"
}
```
@ -93,8 +95,8 @@ Usage:
### Shared Credentials file
You can use an AWS credentials file to specify your credentials. The default
location is $HOME/.aws/credentials on Linux and OS X, or
"%USERPROFILE%.aws\\credentials" for Windows users. If we fail to detect
location is `$HOME/.aws/credentials` on Linux and OS X, or
`%USERPROFILE%.aws\credentials` for Windows users. If we fail to detect
credentials inline, or in the environment, Packer will check this location. You
can optionally specify a different location in the configuration by setting the
environment with the `AWS_SHARED_CREDENTIALS_FILE` variable.
@ -110,9 +112,9 @@ configuration option, or setting the `AWS_PROFILE` environment variable:
```json
{
"profile": "customprofile",
"region": "us-east-1",
"type": "amazon-ebs"
"profile": "customprofile",
"region": "us-east-1",
"type": "amazon-ebs"
}
```
@ -131,9 +133,10 @@ for Packer to work:
```json
{
"Version": "2012-10-17",
"Statement": [{
"Statement": [
{
"Effect": "Allow",
"Action" : [
"Action": [
"ec2:AttachVolume",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CopyImage",
@ -168,8 +171,9 @@ for Packer to work:
"ec2:StopInstances",
"ec2:TerminateInstances"
],
"Resource" : "*"
}]
"Resource": "*"
}
]
}
```
@ -200,15 +204,10 @@ work, but specifics will depend on your use-case.
```json
{
"Sid": "PackerIAMPassRole",
"Effect": "Allow",
"Action": [
"iam:PassRole",
"iam:GetInstanceProfile"
],
"Resource": [
"*"
]
"Sid": "PackerIAMPassRole",
"Effect": "Allow",
"Action": ["iam:PassRole", "iam:GetInstanceProfile"],
"Resource": ["*"]
}
```
@ -217,22 +216,22 @@ IAM policies.
```json
{
"Sid": "PackerIAMCreateRole",
"Effect": "Allow",
"Action": [
"iam:PassRole",
"iam:CreateInstanceProfile",
"iam:DeleteInstanceProfile",
"iam:GetRole",
"iam:GetInstanceProfile",
"iam:DeleteRolePolicy",
"iam:RemoveRoleFromInstanceProfile",
"iam:CreateRole",
"iam:DeleteRole",
"iam:PutRolePolicy",
"iam:AddRoleToInstanceProfile"
],
"Resource": "*"
"Sid": "PackerIAMCreateRole",
"Effect": "Allow",
"Action": [
"iam:PassRole",
"iam:CreateInstanceProfile",
"iam:DeleteInstanceProfile",
"iam:GetRole",
"iam:GetInstanceProfile",
"iam:DeleteRolePolicy",
"iam:RemoveRoleFromInstanceProfile",
"iam:CreateRole",
"iam:DeleteRole",
"iam:PutRolePolicy",
"iam:AddRoleToInstanceProfile"
],
"Resource": "*"
}
```
@ -241,13 +240,10 @@ following policies at a minimum:
```json
{
"Sid": "Allow use of the key",
"Effect": "Allow",
"Action": [
"kms:ReEncrypt*",
"kms:GenerateDataKey*"
],
"Resource": "*"
"Sid": "Allow use of the key",
"Effect": "Allow",
"Action": ["kms:ReEncrypt*", "kms:GenerateDataKey*"],
"Resource": "*"
}
```
@ -255,11 +251,9 @@ If you are using a key provided by a different account than the one you are
using to run the Packer build, your key will also need
```json
"kms:CreateGrant",
"kms:DescribeKey"
("kms:CreateGrant", "kms:DescribeKey")
```
### Checking that system time is current
Amazon uses the current time as part of the [request signing
@ -270,43 +264,41 @@ fail. If that's the case, you might see an error like this:
==> amazon-ebs: Error querying AMI: AuthFailure: AWS was not able to validate the provided access credentials
If you suspect your system's date is wrong, you can compare it against
<http://www.time.gov/>. On
Linux/OS X, you can run the `date` command to get the current time. If you're
`http://www.time.gov/`. On Linux/OS X, you can run the `date` command to get the current time. If you're
on Linux, you can try setting the time with ntp by running `sudo ntpd -q`.
### ResourceNotReady Error
This error generally appears as either `ResourceNotReady: exceeded wait
attempts` or `ResourceNotReady: failed waiting for successful resource state`.
This error generally appears as either `ResourceNotReady: exceeded wait attempts` or `ResourceNotReady: failed waiting for successful resource state`.
This opaque error gets returned from AWS's API for a number of reasons,
generally during image copy/encryption. Possible reasons for the error include:
- You aren't waiting long enough. This is where you'll see the `exceeded wait
attempts` variety of this error message:
- You aren't waiting long enough. This is where you'll see the `exceeded wait attempts` variety of this error message:
We use the AWS SDK's built-in waiters to wait for longer-running tasks to
complete. These waiters have default delays between queries and maximum
number of queries that don't always work for our users.
complete. These waiters have default delays between queries and maximum
number of queries that don't always work for our users.
If you find that you are being rate-limited or have exceeded your max wait
attempts, you can override the defaults by setting the following packer
environment variables (note that these will apply to all AWS tasks that we
have to wait for):
If you find that you are being rate-limited or have exceeded your max wait
attempts, you can override the defaults by setting the following packer
environment variables (note that these will apply to all AWS tasks that we
have to wait for):
- `AWS_MAX_ATTEMPTS` - This is how many times to re-send a status update
- `AWS_MAX_ATTEMPTS` - This is how many times to re-send a status update
request. Excepting tasks that we know can take an extremely long time, this
defaults to 40 tries.
- `AWS_POLL_DELAY_SECONDS` - How many seconds to wait in between status update
- `AWS_POLL_DELAY_SECONDS` - How many seconds to wait in between status update
requests. Generally defaults to 2 or 5 seconds, depending on the task.
- You are using short-lived credentials that expired during the build. If this
is the problem, you may also see `RequestExpired: Request has expired.`
errors displayed in the Packer output:
is the problem, you may also see `RequestExpired: Request has expired.`
errors displayed in the Packer output:
- If you are using STS credentials, make sure that they expire only after the
- If you are using STS credentials, make sure that they expire only after the
build has completed
- If you are chaining roles, make sure your build doesn't last more than an
- If you are chaining roles, make sure your build doesn't last more than an
hour, since when you chain roles the maximum length of time your credentials
will last is an hour:
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
@ -314,7 +306,7 @@ generally during image copy/encryption. Possible reasons for the error include:
- Something is wrong with your KMS key. This is where you'll see the
`ResourceNotReady: failed waiting for successful resource state` variety of
this error message. Issues we've seen include:
- Your KMS key is invalid, possibly because of a typo
- Your KMS key is valid but does not have the necessary permissions (see
above for the necessary key permissions)
- Your KMS key is valid, but not in the region you've told us to use it in.
- Your KMS key is invalid, possibly because of a typo
- Your KMS key is valid but does not have the necessary permissions (see
above for the necessary key permissions)
- Your KMS key is valid, but not in the region you've told us to use it in.

View File

@ -1,12 +1,16 @@
---
description: |
The amazon-instance Packer builder is able to create Amazon AMIs backed by
instance storage as the root device. For more information on the difference
between instance storage and EBS-backed instances, see the storage for the root
device section in the EC2 documentation.
description: >
The amazon-instance Packer builder is able to create Amazon AMIs backed by
instance storage as the root device. For more information on the difference
between instance storage and EBS-backed instances, see the storage for the
root
device section in the EC2 documentation.
layout: docs
page_title: 'Amazon instance-store - Builders'
sidebar_current: 'docs-builders-amazon-instance'
page_title: Amazon instance-store - Builders
sidebar_title: Instance
---
# AMI Builder (instance-store)
@ -26,20 +30,20 @@ AWS account. This builder will create temporary key pairs, security group
rules, etc. that provide it temporary access to the instance while the image is
being created. This simplifies configuration quite a bit.
This builder does *not* manage AMIs. Once it creates an AMI and stores it in
This builder does _not_ manage AMIs. Once it creates an AMI and stores it in
your account, it is up to you to use, delete, etc. the AMI.
-&gt; **Note:** Temporary resources are, by default, all created with the
-> **Note:** Temporary resources are, by default, all created with the
prefix `packer`. This can be useful if you want to restrict the security groups
and key pairs packer is able to operate on.
-&gt; **Note:** This builder requires that the [Amazon EC2 AMI
-> **Note:** This builder requires that the [Amazon EC2 AMI
Tools](https://aws.amazon.com/developertools/368) are installed onto the
machine. This can be done within a provisioner, but must be done before the
builder finishes running.
\~&gt; Instance builds are not supported for Windows. Use
[`amazon-ebs`](amazon-ebs.html) instead.
~> Instance builds are not supported for Windows. Use
[`amazon-ebs`](/docs/builders/amazon-ebs) instead.
## Configuration Reference
@ -55,42 +59,41 @@ necessary for this build to succeed and can be found further down the page.
### Required:
<%= partial "partials/builder/amazon/instance/Config-required" %>
@include 'builder/amazon/instance/Config-required.mdx'
### Optional:
<%= partial "partials/builder/amazon/instance/Config-not-required" %>
@include 'builder/amazon/instance/Config-not-required.mdx'
### AMI Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AMIConfig-required" %>
@include 'builder/amazon/common/AMIConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/AMIConfig-not-required" %>
@include 'builder/amazon/common/AMIConfig-not-required.mdx'
### Access Configuration
#### Required:
<%= partial "partials/builder/amazon/common/AccessConfig-required" %>
@include 'builder/amazon/common/AccessConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/AccessConfig-not-required" %>
@include 'builder/amazon/common/AccessConfig-not-required.mdx'
### Run Configuration
#### Required:
<%= partial "partials/builder/amazon/common/RunConfig-required" %>
@include 'builder/amazon/common/RunConfig-required.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/RunConfig-not-required" %>
@include 'builder/amazon/common/RunConfig-not-required.mdx'
### Block Devices Configuration
@ -98,18 +101,19 @@ Block devices can be nested in the
[ami_block_device_mappings](#ami_block_device_mappings) or the
[launch_block_device_mappings](#launch_block_device_mappings) array.
<%= partial "partials/builder/amazon/common/BlockDevice" %>
@include 'builder/amazon/common/BlockDevice.mdx'
#### Optional:
<%= partial "partials/builder/amazon/common/BlockDevice-not-required" %>
@include 'builder/amazon/common/BlockDevice-not-required.mdx'
### Communicator Configuration
#### Optional:
<%= partial "partials/helper/communicator/Config-not-required" %>
<%= partial "partials/helper/communicator/SSH-not-required" %>
@include 'helper/communicator/Config-not-required.mdx'
@include 'helper/communicator/SSH-not-required.mdx'
## Basic Example
@ -135,7 +139,7 @@ Here is a basic example. It is completely valid except for the access keys:
}
```
-&gt; **Note:** Packer can also read the access key and secret access key from
-> **Note:** Packer can also read the access key and secret access key from
environmental variables. See the configuration reference in the section above
for more information on what environmental variables Packer will look for.
@ -151,25 +155,25 @@ You can use this information to access the instance as it is running.
In configuration directives marked as a template engine above, the following
variables are available:
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
- `BuildRegion` - The region (for example `eu-central-1`) where Packer is
building the AMI.
- `SourceAMI` - The source AMI ID (for example `ami-a2412fcd`) used to build
the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIOwner` - The source AMI owner ID.
- `SourceAMIOwnerName` - The source AMI owner alias/name (for example `amazon`).
- `SourceAMITags` - The source AMI Tags, as a `map[string]string` object.
## Build function template engine variables
For the build function of [template engine](/docs/templates/engine.html), the following
For the build function of [template engine](/docs/templates/engine), the following
variables are available:
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
- `SourceAMIName` - The source AMI Name (for example
`ubuntu/images/ebs-ssd/ubuntu-xenial-16.04-amd64-server-20180306`) used to
build the AMI.
## Custom Bundle Commands
@ -185,7 +189,7 @@ upload the AMI.
These are configured with `bundle_vol_command` and `bundle_upload_command`.
Both of these configurations are [configuration
templates](/docs/templates/engine.html) and have support for their own set of
templates](/docs/templates/engine) and have support for their own set of
template variables.
### Bundle Volume Command
@ -195,7 +199,7 @@ multiple lines for convenience of reading. The bundle volume command is
responsible for executing `ec2-bundle-vol` in order to store and image of the
root filesystem to use to create the AMI.
``` text
```text
sudo -i -n ec2-bundle-vol \
-k {{.KeyPath}} \
-u {{.AccountId}} \
@ -211,7 +215,7 @@ sudo -i -n ec2-bundle-vol \
The available template variables should be self-explanatory based on the
parameters they're used to satisfy the `ec2-bundle-vol` command.
\~&gt; **Warning!** Some versions of ec2-bundle-vol silently ignore all .pem
~> **Warning!** Some versions of ec2-bundle-vol silently ignore all .pem
and .gpg files during the bundling of the AMI, which can cause problems on some
systems, such as Ubuntu. You may want to customize the bundle volume command to
include those files (see the `--no-filter` option of `ec2-bundle-vol`).
@ -223,7 +227,7 @@ across multiple lines for convenience of reading. Access key and secret key are
omitted if using instance profile. The bundle upload command is responsible for
taking the bundled volume and uploading it to S3.
``` text
```text
sudo -i -n ec2-upload-bundle \
-b {{.BucketName}} \
-m {{.ManifestPath}} \
@ -248,24 +252,23 @@ this:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:PutObjectAcl"
],
"Resource": "*"
}
]
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:PutObjectAcl"
],
"Resource": "*"
}
]
}
```
You may wish to constrain the resource to a specific bucket.
<%= partial "partials/builders/aws-ssh-differentiation-table" %>
@include 'builders/aws-ssh-differentiation-table.mdx'

View File

@ -1,8 +1,8 @@
---
description: 'Packer supports building VHDs in Azure Resource manager.'
description: Packer supports building VHDs in Azure Resource manager.
layout: docs
page_title: 'Azure arm - Builders'
sidebar_current: 'docs-builders-azure-arm'
page_title: Azure arm - Builders
sidebar_title: ARM
---
# Azure Resource Manager Builder
@ -11,13 +11,13 @@ Type: `azure-arm`
Packer supports building VHDs and Managed Images in [Azure Resource
Manager](https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/).
Azure provides new users a [$200 credit for the first 30
Azure provides new users a [`$200` credit for the first 30
days](https://azure.microsoft.com/en-us/free/); after which you will incur
costs for VMs built and stored using Packer.
Azure uses a combination of OAuth and Active Directory to authorize requests to
the ARM API. Learn how to [authorize access to
ARM](/docs/builders/azure.html#authentication-for-azure).
ARM](/docs/builders/azure#authentication-for-azure).
The documentation below references command output from the [Azure
CLI](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/).
@ -26,43 +26,45 @@ CLI](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/
There are many configuration options available for the builder. We'll start
with authentication parameters, then go over the Azure ARM builder specific
options. In addition to the options listed here, a [communicator](/docs/templates/communicator.html) can be configured for this builder.
options. In addition to the options listed here, a [communicator](/docs/templates/communicator) can be configured for this builder.
### Authentication options
<%= partial "partials/builder/azure/common/client/_Config" %>
@include 'builder/azure/common/client/Config.mdx'
#### Managed Identity
If you're running packer on an Azure VM with a [managed identity](/docs/builders/azure.html#azure-managed-identity) you don't need to specify any additional configuration options. As Packer will attempt to use the Managed Identity and subscription of the VM that Packer is running on.
If you're running packer on an Azure VM with a [managed identity](/docs/builders/azure#azure-managed-identity) you don't need to specify any additional configuration options. As Packer will attempt to use the Managed Identity and subscription of the VM that Packer is running on.
#### Interactive User Authentication
To use interactive user authentication, you should specify `subscription_id` only.
Packer will use cached credentials or redirect you to a website to log in.
#### Service Principal
To use a [service principal](/docs/builders/azure.html#azure-active-directory-service-principal)
To use a [service principal](/docs/builders/azure#azure-active-directory-service-principal)
you should specify `subscription_id`, `client_id` and one of `client_secret`,
`client_cert_path` or `client_jwt`.
- `subscription_id` (string) - Subscription under which the build will be
performed. **The service principal specified in `client_id` must have full
access to this subscription, unless build\_resource\_group\_name option is
specified in which case it needs to have owner access to the existing
resource group specified in build\_resource\_group\_name parameter.**
- `subscription_id` (string) - Subscription under which the build will be
performed. **The service principal specified in `client_id` must have full
access to this subscription, unless build_resource_group_name option is
specified in which case it needs to have owner access to the existing
resource group specified in build_resource_group_name parameter.**
- `client_id` (string) - The Active Directory service principal associated with
your builder.
- `client_id` (string) - The Active Directory service principal associated with
your builder.
- `client_secret` (string) - The password or secret for your service principal.
- `client_cert_path` (string) - The location of a PEM file containing a
certificate and private key for service principal.
- `client_jwt` (string) - The bearer JWT assertion signed using a certificate
associated with your service principal principal. See [Azure Active
Directory docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials)
for more information.
- `client_secret` (string) - The password or secret for your service principal.
- `client_cert_path` (string) - The location of a PEM file containing a
certificate and private key for service principal.
- `client_jwt` (string) - The bearer JWT assertion signed using a certificate
associated with your service principal principal. See [Azure Active
Directory docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials)
for more information.
### Azure ARM builder specific options
@ -72,39 +74,39 @@ a managed image you **must** start with a managed image.
### Required:
<%= partial "partials/builder/azure/arm/Config-required" %>
@include 'builder/azure/arm/Config-required.mdx'
When creating a VHD the following additional options are required:
- `capture_container_name` (string) - Destination container name. Essentially
the "directory" where your VHD will be organized in Azure. The captured
VHD's URL will be
`https://<storage_account>.blob.core.windows.net/system/Microsoft.Compute/Images/<capture_container_name>/<capture_name_prefix>.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.vhd`.
- `capture_container_name` (string) - Destination container name. Essentially
the "directory" where your VHD will be organized in Azure. The captured
VHD's URL will be
`https://<storage_account>.blob.core.windows.net/system/Microsoft.Compute/Images/<capture_container_name>/<capture_name_prefix>.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.vhd`.
- `capture_name_prefix` (string) - VHD prefix. The final artifacts will be
named `PREFIX-osDisk.UUID` and `PREFIX-vmTemplate.UUID`.
- `capture_name_prefix` (string) - VHD prefix. The final artifacts will be
named `PREFIX-osDisk.UUID` and `PREFIX-vmTemplate.UUID`.
- `resource_group_name` (string) - Resource group under which the final
artifact will be stored.
- `resource_group_name` (string) - Resource group under which the final
artifact will be stored.
- `storage_account` (string) - Storage account under which the final artifact
will be stored.
- `storage_account` (string) - Storage account under which the final artifact
will be stored.
When creating a managed image the following additional options are required:
- `managed_image_name` (string) - Specify the managed image name where the
result of the Packer build will be saved. The image name must not exist
ahead of time, and will not be overwritten. If this value is set, the value
`managed_image_resource_group_name` must also be set. See
[documentation](https://docs.microsoft.com/en-us/azure/storage/storage-managed-disks-overview#images)
to learn more about managed images.
- `managed_image_name` (string) - Specify the managed image name where the
result of the Packer build will be saved. The image name must not exist
ahead of time, and will not be overwritten. If this value is set, the value
`managed_image_resource_group_name` must also be set. See
[documentation](https://docs.microsoft.com/en-us/azure/storage/storage-managed-disks-overview#images)
to learn more about managed images.
- `managed_image_resource_group_name` (string) - Specify the managed image
resource group name where the result of the Packer build will be saved. The
resource group must already exist. If this value is set, the value
`managed_image_name` must also be set. See
[documentation](https://docs.microsoft.com/en-us/azure/storage/storage-managed-disks-overview#images)
to learn more about managed images.
- `managed_image_resource_group_name` (string) - Specify the managed image
resource group name where the result of the Packer build will be saved. The
resource group must already exist. If this value is set, the value
`managed_image_name` must also be set. See
[documentation](https://docs.microsoft.com/en-us/azure/storage/storage-managed-disks-overview#images)
to learn more about managed images.
#### Shared Image Gallery
@ -141,29 +143,29 @@ artifacts.
To have packer create a resource group you **must** provide:
- `location` (string) Azure datacenter in which your VM will build.
- `location` (string) Azure datacenter in which your VM will build.
CLI example `az account list-locations`
CLI example `az account list-locations`
and optionally:
- `temp_resource_group_name` (string) name assigned to the temporary resource
group created during the build. If this value is not set, a random value
will be assigned. This resource group is deleted at the end of the build.
- `temp_resource_group_name` (string) name assigned to the temporary resource
group created during the build. If this value is not set, a random value
will be assigned. This resource group is deleted at the end of the build.
To use an existing resource group you **must** provide:
- `build_resource_group_name` (string) - Specify an existing resource group
to run the build in.
- `build_resource_group_name` (string) - Specify an existing resource group
to run the build in.
Providing `temp_resource_group_name` or `location` in combination with
`build_resource_group_name` is not allowed.
### Optional:
<%= partial "partials/builder/azure/arm/Config-not-required" %>
<%= partial "partials/builder/azure/common/client/_Config-not-required" %>
@include 'builder/azure/arm/Config-not-required.mdx'
@include 'builder/azure/common/client/Config-not-required.mdx'
## Basic Example
@ -171,29 +173,29 @@ Here is a basic example for Azure.
```json
{
"type": "azure-arm",
"type": "azure-arm",
"client_id": "fe354398-d7sf-4dc9-87fd-c432cd8a7e09",
"client_secret": "keepitsecret&#*$",
"resource_group_name": "packerdemo",
"storage_account": "virtualmachines",
"subscription_id": "44cae533-4247-4093-42cf-897ded6e7823",
"tenant_id": "de39842a-caba-497e-a798-7896aea43218",
"client_id": "fe354398-d7sf-4dc9-87fd-c432cd8a7e09",
"client_secret": "keepitsecret&#*$",
"resource_group_name": "packerdemo",
"storage_account": "virtualmachines",
"subscription_id": "44cae533-4247-4093-42cf-897ded6e7823",
"tenant_id": "de39842a-caba-497e-a798-7896aea43218",
"capture_container_name": "images",
"capture_name_prefix": "packer",
"capture_container_name": "images",
"capture_name_prefix": "packer",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "14.04.4-LTS",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "14.04.4-LTS",
"azure_tags": {
"dept": "engineering"
},
"azure_tags": {
"dept": "engineering"
},
"location": "West US",
"vm_size": "Standard_A2"
"location": "West US",
"vm_size": "Standard_A2"
}
```
@ -218,18 +220,18 @@ here](https://technet.microsoft.com/en-us/library/hh824815.aspx)
```json
{
"provisioners": [
"provisioners": [
{
"type": "powershell",
"inline": [
" # NOTE: the following *3* lines are only needed if the you have installed the Guest Agent.",
" while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
" while ((Get-Service WindowsAzureTelemetryService).Status -ne 'Running') { Start-Sleep -s 5 }",
" while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
"type": "powershell",
"inline": [
" # NOTE: the following *3* lines are only needed if the you have installed the Guest Agent.",
" while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
" while ((Get-Service WindowsAzureTelemetryService).Status -ne 'Running') { Start-Sleep -s 5 }",
" while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
"& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit /mode:vm",
"while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }"
]
"& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit /mode:vm",
"while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }"
]
}
]
}
@ -254,30 +256,30 @@ Deprovision should be the last operation executed by a build.
```json
{
"provisioners": [
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
"provisioners": [
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
}
```
To learn more about the Linux deprovision process please see WALinuxAgent's
[README](https://github.com/Azure/WALinuxAgent/blob/master/README.md).
#### skip\_clean
#### skip_clean
Customers have reported issues with the deprovision process where the builder
hangs. The error message is similar to the following.
Build 'azure-arm' errored: Retryable error: Error removing temporary script at /tmp/script_9899.sh: ssh: handshake failed: EOF
One solution is to set skip\_clean to true in the provisioner. This prevents
One solution is to set skip_clean to true in the provisioner. This prevents
Packer from cleaning up any helper scripts uploaded to the VM during the build.
## Defaults
@ -285,21 +287,21 @@ Packer from cleaning up any helper scripts uploaded to the VM during the build.
The Azure builder attempts to pick default values that provide for a just works
experience. These values can be changed by the user to more suitable values.
- The default user name is packer not root as in other builders. Most distros
on Azure do not allow root to SSH to a VM hence the need for a non-root
default user. Set the ssh\_username option to override the default value.
- The default VM size is Standard\_A1. Set the vm\_size option to override
the default value.
- The default image version is latest. Set the image\_version option to
override the default value.
- By default a temporary resource group will be created and destroyed as part
of the build. If you do not have permissions to do so, use
`build_resource_group_name` to specify an existing resource group to run
the build in.
- The default user name is packer not root as in other builders. Most distros
on Azure do not allow root to SSH to a VM hence the need for a non-root
default user. Set the ssh_username option to override the default value.
- The default VM size is Standard_A1. Set the vm_size option to override
the default value.
- The default image version is latest. Set the image_version option to
override the default value.
- By default a temporary resource group will be created and destroyed as part
of the build. If you do not have permissions to do so, use
`build_resource_group_name` to specify an existing resource group to run
the build in.
## Implementation
\~&gt; **Warning!** This is an advanced topic. You do not need to understand
~> **Warning!** This is an advanced topic. You do not need to understand
the implementation to use the Azure builder.
The Azure builder uses ARM
@ -338,27 +340,27 @@ templated with place holders for names, passwords, SSH keys, certificates, etc.
The Azure builder creates the following random values at runtime.
- Administrator Password: a random 32-character value using the *password
alphabet*.
- Certificate: a 2,048-bit certificate used to secure WinRM communication.
The certificate is valid for 24-hours, which starts roughly at invocation
time.
- Certificate Password: a random 32-character value using the *password
alphabet* used to protect the private key of the certificate.
- Compute Name: a random 15-character name prefixed with pkrvm; the name of
the VM.
- Deployment Name: a random 15-character name prefixed with pkfdp; the name
of the deployment.
- KeyVault Name: a random 15-character name prefixed with pkrkv.
- NIC Name: a random 15-character name prefixed with pkrni.
- Public IP Name: a random 15-character name prefixed with pkrip.
- OS Disk Name: a random 15-character name prefixed with pkros.
- Resource Group Name: a random 33-character name prefixed with
packer-Resource-Group-.
- Subnet Name: a random 15-character name prefixed with pkrsn.
- SSH Key Pair: a 2,048-bit asymmetric key pair; can be overridden by the
user.
- Virtual Network Name: a random 15-character name prefixed with pkrvn.
- Administrator Password: a random 32-character value using the _password
alphabet_.
- Certificate: a 2,048-bit certificate used to secure WinRM communication.
The certificate is valid for 24-hours, which starts roughly at invocation
time.
- Certificate Password: a random 32-character value using the _password
alphabet_ used to protect the private key of the certificate.
- Compute Name: a random 15-character name prefixed with pkrvm; the name of
the VM.
- Deployment Name: a random 15-character name prefixed with pkfdp; the name
of the deployment.
- KeyVault Name: a random 15-character name prefixed with pkrkv.
- NIC Name: a random 15-character name prefixed with pkrni.
- Public IP Name: a random 15-character name prefixed with pkrip.
- OS Disk Name: a random 15-character name prefixed with pkros.
- Resource Group Name: a random 33-character name prefixed with
packer-Resource-Group-.
- Subnet Name: a random 15-character name prefixed with pkrsn.
- SSH Key Pair: a 2,048-bit asymmetric key pair; can be overridden by the
user.
- Virtual Network Name: a random 15-character name prefixed with pkrvn.
The default alphabet used for random values is
**0123456789bcdfghjklmnpqrstvwxyz**. The alphabet was reduced (no vowels) to

View File

@ -1,10 +1,12 @@
---
description: |
The azure-chroot Packer builder is able to create Azure Managed Images leveraging
a VM in Azure.
description: >
The azure-chroot Packer builder is able to create Azure Managed Images
leveraging
a VM in Azure.
layout: docs
page_title: 'Azure chroot - Builders'
sidebar_current: 'docs-builders-azure-chroot'
page_title: Azure chroot - Builders
sidebar_title: chroot
---
# Azure Builder (chroot)
@ -22,26 +24,27 @@ content and enables some capabilities that are not possible with the
`azure-arm` builder.
> **This is an advanced builder** If you're just getting started with Packer,
it is recommend to start with the [azure-arm builder](/docs/builders/azure-arm.html),
which is much easier to use.
> it is recommend to start with the [azure-arm builder](/docs/builders/azure-arm),
> which is much easier to use.
## How Does it Work?
This builder works by creating a new MD from either an existing source or from
scratch and attaching it to the (already existing) Azure VM where Packer is
scratch and attaching it to the (already existing) Azure VM where Packer is
running. Once attached, a [chroot](https://en.wikipedia.org/wiki/Chroot) is set
up and made available to the [provisioners](/docs/provisioners/index.html).
up and made available to the [provisioners](/docs/provisioners).
After provisioning, the MD is detached, snapshotted and a MD image is created.
Using this process, minutes can be shaved off the image creation process
because Packer does not need to launch a VM instance.
There are some restrictions however:
* The host system must be a similar system (generally the same OS version,
- The host system must be a similar system (generally the same OS version,
kernel versions, etc.) as the image being built.
* If the source is a managed disk, it must be made available in the same
- If the source is a managed disk, it must be made available in the same
region as the host system.
* The host system SKU has to allow for all of the specified disks to be
- The host system SKU has to allow for all of the specified disks to be
attached.
## Configuration Reference
@ -51,20 +54,23 @@ with authentication parameters, then go over the Azure chroot builder specific
options.
### Authentication options
None of the authentication options are required, but depending on which
ones are specified a different authentication method may be used. See the
[shared Azure builders documentation](/docs/builders/azure.html) for more
[shared Azure builders documentation](/docs/builders/azure) for more
information.
<%= partial "partials/builder/azure/common/client/_Config-not-required.html" %>
@include 'builder/azure/common/client/Config-not-required.mdx'
### Azure chroot builder specific options
#### Required:
<%= partial "partials/builder/azure/chroot/_Config-required.html" %>
@include 'builder/azure/chroot/Config-required.mdx'
#### Optional:
<%= partial "partials/builder/azure/chroot/_Config-not-required.html" %>
@include 'builder/azure/chroot/Config-not-required.mdx'
## Chroot Mounts
@ -72,11 +78,11 @@ The `chroot_mounts` configuration can be used to mount specific devices within
the chroot. By default, the following additional mounts are added into the
chroot by Packer:
- `/proc` (proc)
- `/sys` (sysfs)
- `/dev` (bind to real `/dev`)
- `/dev/pts` (devpts)
- `/proc/sys/fs/binfmt_misc` (binfmt\_misc)
- `/proc` (proc)
- `/sys` (sysfs)
- `/dev` (bind to real `/dev`)
- `/dev/pts` (devpts)
- `/proc/sys/fs/binfmt_misc` (binfmt_misc)
These default mounts are usually good enough for anyone and are sane defaults.
However, if you want to change or add the mount points, you may using the
@ -95,65 +101,71 @@ mounts `/prod` and `/dev`:
`chroot_mounts` is a list of a 3-tuples of strings. The three components of the
3-tuple, in order, are:
- The filesystem type. If this is "bind", then Packer will properly bind the
filesystem to another mount point.
- The filesystem type. If this is "bind", then Packer will properly bind the
filesystem to another mount point.
- The source device.
- The source device.
- The mount directory.
- The mount directory.
## Additional template function
Because this builder runs on an Azure VM, there is an additional template function
available called `vm`, which returns the following VM metadata:
- name
- subscription_id
- resource_group
- location
- resource_id
- name
- subscription_id
- resource_group
- location
- resource_id
This function can be used in the configuration templates, for example, use
```
```text
"{{ vm `subscription_id` }}"
```
to fill in the subscription ID of the VM in any of the configuration options.
## Examples
Here are some examples using this builder.
This builder requires privileged actions, such as mounting disks, running
`chroot` and other admin commands. Usually it needs to be run with root
permissions, for example:
```
```shell
sudo -E packer build example.json
```
### Using a VM with a Managed Identity
On a VM with a system-assigned managed identity that has the contributor role
on its own resource group, the following config can be used to create an
updated Debian image:
```json
{
"builders": [{
"type": "azure-chroot",
"builders": [
{
"type": "azure-chroot",
"image_resource_id": "/subscriptions/{{vm `subscription_id`}}/resourceGroups/{{vm `resource_group`}}/providers/Microsoft.Compute/images/MyDebianOSImage-{{timestamp}}",
"source": "credativ:Debian:9:latest"
}],
"provisioners": [{
"inline": [
"apt-get update",
"apt-get upgrade -y"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}]
"image_resource_id": "/subscriptions/{{vm `subscription_id`}}/resourceGroups/{{vm `resource_group`}}/providers/Microsoft.Compute/images/MyDebianOSImage-{{timestamp}}",
"source": "credativ:Debian:9:latest"
}
],
"provisioners": [
{
"inline": ["apt-get update", "apt-get upgrade -y"],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
}
```
### Using a Service Principal
Here is an example that creates a Debian image with updated packages. Specify
all environment variables (`ARM_CLIENT_ID`, `ARM_CLIENT_SECRET`,
`ARM_SUBSCRIPTION_ID`) to use a service principal.
@ -170,24 +182,25 @@ subscription where the resulting image will be created.
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
"resource_group": "{{env `ARM_IMAGE_RESOURCEGROUP_ID`}}"
},
"builders": [{
"type": "azure-chroot",
"builders": [
{
"type": "azure-chroot",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"subscription_id": "{{user `subscription_id`}}",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"subscription_id": "{{user `subscription_id`}}",
"image_resource_id": "/subscriptions/{{user `subscription_id`}}/resourceGroups/{{user `resource_group`}}/providers/Microsoft.Compute/images/MyDebianOSImage-{{timestamp}}",
"image_resource_id": "/subscriptions/{{user `subscription_id`}}/resourceGroups/{{user `resource_group`}}/providers/Microsoft.Compute/images/MyDebianOSImage-{{timestamp}}",
"source": "credativ:Debian:9:latest"
}],
"provisioners": [{
"inline": [
"apt-get update",
"apt-get upgrade -y"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}]
"source": "credativ:Debian:9:latest"
}
],
"provisioners": [
{
"inline": ["apt-get update", "apt-get upgrade -y"],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
}
```
```

View File

@ -1,45 +1,47 @@
---
description: |
Packer is able to create Azure VM images. To achieve this, Packer comes with
multiple builders depending on the strategy you want to use to build the images.
description: >
Packer is able to create Azure VM images. To achieve this, Packer comes with
multiple builders depending on the strategy you want to use to build the
images.
layout: docs
page_title: 'Azure images - Builders'
sidebar_current: 'docs-builders-azure'
page_title: Azure images - Builders
sidebar_title: Azure
---
# Azure Virtual Machine Image Builders
Packer can create Azure virtual machine images through variety of ways
depending on the strategy that you want to use for building the images.
Packer can create Azure virtual machine images through variety of ways
depending on the strategy that you want to use for building the images.
Packer supports the following builders for Azure images at the moment:
- [azure-arm](/docs/builders/azure-arm.html) - Uses Azure Resource
Manager (ARM) to launch a virtual machine (VM) from which a new image is
captured after provisioning. If in doubt, use this builder; it is the
easiest builder to get started with.
- [azure-arm](/docs/builders/azure-arm) - Uses Azure Resource
Manager (ARM) to launch a virtual machine (VM) from which a new image is
captured after provisioning. If in doubt, use this builder; it is the
easiest builder to get started with.
- [azure-chroot](/docs/builders/azure-chroot.html) - Uses ARM to create
a managed disk that is attached to an existing Azure VM that Packer is
running on. Provisioning leverages [Chroot](https://en.wikipedia.org/wiki/Chroot)
environment. After provisioning, the disk is detached an image is created
from this disk. This is an **advanced builder and should not be used by
newcomers**. However, it is also the fastest way to build a VM image in
Azure.
- [azure-chroot](/docs/builders/azure-chroot) - Uses ARM to create
a managed disk that is attached to an existing Azure VM that Packer is
running on. Provisioning leverages [Chroot](https://en.wikipedia.org/wiki/Chroot)
environment. After provisioning, the disk is detached an image is created
from this disk. This is an **advanced builder and should not be used by
newcomers**. However, it is also the fastest way to build a VM image in
Azure.
-&gt; **Don't know which builder to use?** If in doubt, use the [azure-arm
builder](/docs/builders/azure-arm.html). It is much easier to use.
-> **Don't know which builder to use?** If in doubt, use the [azure-arm
builder](/docs/builders/azure-arm). It is much easier to use.
# Authentication for Azure
The Packer Azure builders provide a couple of ways to authenticate to Azure. The
following methods are available and are explained below:
- Azure Active Directory interactive login. Interactive login is available
for the Public and US Gov clouds only.
- Azure Managed Identity
- Azure Active Directory Service Principal
- Azure Active Directory interactive login. Interactive login is available
for the Public and US Gov clouds only.
- Azure Managed Identity
- Azure Active Directory Service Principal
-&gt; **Don't know which authentication method to use?** Go with interactive
-> **Don't know which authentication method to use?** Go with interactive
login to try out the builders. If you need packer to run automatically,
switch to using a Service Principal or Managed Identity.
@ -75,27 +77,26 @@ To get started, try assigning the `Contributor` role at the subscription level t
your VM. Then, when you discover your exact scenario, scope the permissions
appropriately or isolate Packer builds in a separate subscription.
## Azure Active Directory Service Principal
## Azure Active Directory Service Principal
Azure Active Directory models service accounts as 'Service Principal' (SP)
objects. An SP represents an application accessing your Azure resources. It
is identified by a client ID (aka application ID) and can use a password or a
certificate to authenticate. To use a Service Principal, specify the
certificate to authenticate. To use a Service Principal, specify the
`subscription_id` and `client_id`, as well as either `client_secret`,
`client_cert_path` or `client_jwt`. Each of these last three represent a different
way to authenticate the SP to AAD:
- `client_secret` - allows the user to provide a password/secret registered
for the AAD SP.
- `client_cert_path` - allows usage of a certificate to be used to
authenticate as the specified AAD SP.
- `client_jwt` - For advanced scenario's where the used cannot provide Packer
the full certificate, they can provide a JWT bearer token for client auth
(RFC 7523, Sec. 2.2). These bearer tokens are created and signed using a
certificate registered in AAD and have a user-chosen expiry time, limiting
the validity of the token. This is also the underlying mechanism used to
authenticate when using `client_cert_path`.
- `client_secret` - allows the user to provide a password/secret registered
for the AAD SP.
- `client_cert_path` - allows usage of a certificate to be used to
authenticate as the specified AAD SP.
- `client_jwt` - For advanced scenario's where the used cannot provide Packer
the full certificate, they can provide a JWT bearer token for client auth
(RFC 7523, Sec. 2.2). These bearer tokens are created and signed using a
certificate registered in AAD and have a user-chosen expiry time, limiting
the validity of the token. This is also the underlying mechanism used to
authenticate when using `client_cert_path`.
To create a service principal, you can follow [the Azure documentation on this
subject](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest).

View File

@ -0,0 +1,235 @@
---
description: |
The cloudstack Packer builder is able to create new templates for use with
CloudStack. The builder takes either an ISO or an existing template as it's
source, runs any provisioning necessary on the instance after launching it and
then creates a new template from that instance.
layout: docs
page_title: CloudStack - Builders
sidebar_title: CloudStack
---
# CloudStack Builder
Type: `cloudstack`
The `cloudstack` Packer builder is able to create new templates for use with
[CloudStack](https://cloudstack.apache.org/). The builder takes either an ISO
or an existing template as it's source, runs any provisioning necessary on the
instance after launching it and then creates a new template from that instance.
The builder does _not_ manage templates. Once a template is created, it is up
to you to use it or delete it.
## Configuration Reference
There are many configuration options available for the builder. They are
segmented below into two categories: required and optional parameters. Within
each category, the available configuration keys are alphabetized.
In addition to the options listed here, a
[communicator](/docs/templates/communicator) can be configured for this
builder.
### Required:
- `api_url` (string) - The CloudStack API endpoint we will connect to. It can
also be specified via environment variable `CLOUDSTACK_API_URL`, if set.
- `api_key` (string) - The API key used to sign all API requests. It can also
be specified via environment variable `CLOUDSTACK_API_KEY`, if set.
- `network` (string) - The name or ID of the network to connect the instance
to.
- `secret_key` (string) - The secret key used to sign all API requests. It
can also be specified via environment variable `CLOUDSTACK_SECRET_KEY`, if
set.
- `service_offering` (string) - The name or ID of the service offering used
for the instance.
- `source_iso` (string) - The name or ID of an ISO that will be mounted
before booting the instance. This option is mutually exclusive with
`source_template`. When using `source_iso`, both `disk_offering` and
`hypervisor` are required.
- `source_template` (string) - The name or ID of the template used as base
template for the instance. This option is mutually exclusive with
`source_iso`.
- `template_os` (string) - The name or ID of the template OS for the new
template that will be created.
- `zone` (string) - The name or ID of the zone where the instance will be
created.
### Optional:
- `async_timeout` (number) - The time duration to wait for async calls to
finish. Defaults to 30m.
- `cidr_list` (array) - List of CIDR's that will have access to the new
instance. This is needed in order for any provisioners to be able to
connect to the instance. Defaults to `[ "0.0.0.0/0" ]`. Only required when
`use_local_ip_address` is `false`.
- `create_security_group` (boolean) - If `true` a temporary security group
will be created which allows traffic towards the instance from the
`cidr_list`. This option will be ignored if `security_groups` is also
defined. Requires `expunge` set to `true`. Defaults to `false`.
- `disk_offering` (string) - The name or ID of the disk offering used for the
instance. This option is only available (and also required) when using
`source_iso`.
- `disk_size` (number) - The size (in GB) of the root disk of the new
instance. This option is only available when using `source_template`.
- `expunge` (boolean) - Set to `true` to expunge the instance when it is
destroyed. Defaults to `false`.
- `http_directory` (string) - Path to a directory to serve using an HTTP
server. The files in this directory will be available over HTTP that will
be requestable from the virtual machine. This is useful for hosting
kickstart files and so on. By default this is "", which means no HTTP
server will be started. The address and port of the HTTP server will be
available as variables in `user_data`. This is covered in more detail
below.
- `http_get_only` (boolean) - Some cloud providers only allow HTTP GET calls
to their CloudStack API. If using such a provider, you need to set this to
`true` in order for the provider to only make GET calls and no POST calls.
- `http_port_min` and `http_port_max` (number) - These are the minimum and
maximum port to use for the HTTP server started to serve the
`http_directory`. Because Packer often runs in parallel, Packer will choose
a randomly available port in this range to run the HTTP server. If you want
to force the HTTP server to be on one port, make this minimum and maximum
port the same. By default the values are 8000 and 9000, respectively.
- `hypervisor` (string) - The target hypervisor (e.g. `XenServer`, `KVM`) for
the new template. This option is required when using `source_iso`.
- `eject_iso` (boolean) - If `true` make a call to the CloudStack API, after
loading image to cache, requesting to check and detach ISO file (if any)
currently attached to a virtual machine. Defaults to `false`. This option
is only available when using `source_iso`.
- `eject_iso_delay` (time.Duration) - Configure the duration time to wait, making
sure virtual machine is able to finish installing OS before it ejects safely.
Requires `eject_iso` set to `true` and this option is only available when
using `source_iso`.
- `keypair` (string) - The name of the SSH key pair that will be used to
access the instance. The SSH key pair is assumed to be already available
within CloudStack.
- `instance_name` (string) - The name of the instance. Defaults to
"packer-UUID" where UUID is dynamically generated.
- `prevent_firewall_changes` (boolean) - Set to `true` to prevent network
ACLs or firewall rules creation. Defaults to `false`.
- `project` (string) - The name or ID of the project to deploy the instance
to.
- `public_ip_address` (string) - The public IP address or it's ID used for
connecting any provisioners to. If not provided, a temporary public IP
address will be associated and released during the Packer run.
- `public_port` (number) - The fixed port you want to configure in the port
forwarding rule. Set this attribute if you do not want to use the a random
public port.
- `security_groups` (array of strings) - A list of security group IDs or
names to associate the instance with.
- `ssh_agent_auth` (boolean) - If true, the local SSH agent will be used to
authenticate connections to the source instance. No temporary keypair will
be created, and the values of `ssh_password` and `ssh_private_key_file`
will be ignored. To use this option with a key pair already configured in
the source image, leave the `keypair` blank. To associate an existing key
pair with the source instance, set the `keypair` field to the name of the
key pair.
- `ssl_no_verify` (boolean) - Set to `true` to skip SSL verification.
Defaults to `false`.
- `template_display_text` (string) - The display text of the new template.
Defaults to the `template_name`.
- `template_featured` (boolean) - Set to `true` to indicate that the template
is featured. Defaults to `false`.
- `template_name` (string) - The name of the new template. Defaults to
`packer-{{timestamp}}` where timestamp will be the current time.
- `template_public` (boolean) - Set to `true` to indicate that the template
is available for all accounts. Defaults to `false`.
- `template_password_enabled` (boolean) - Set to `true` to indicate the
template should be password enabled. Defaults to `false`.
- `template_requires_hvm` (boolean) - Set to `true` to indicate the template
requires hardware-assisted virtualization. Defaults to `false`.
- `template_scalable` (boolean) - Set to `true` to indicate that the template
contains tools to support dynamic scaling of VM cpu/memory. Defaults to
`false`.
- `temporary_keypair_name` (string) - The name of the temporary SSH key pair
to generate. By default, Packer generates a name that looks like
`packer_<UUID>`, where &lt;UUID&gt; is a 36 character unique identifier.
- `user_data` (string) - User data to launch with the instance. This is a
[template engine](/docs/templates/engine) see _User Data_ bellow for
more details. Packer will not automatically wait for a user script to
finish before shutting down the instance this must be handled in a
provisioner.
- `user_data_file` (string) - Path to a file that will be used for the user
data when launching the instance. This file will be parsed as a [template
engine](/docs/templates/engine) see _User Data_ bellow for more
details.
- `use_local_ip_address` (boolean) - Set to `true` to indicate that the
provisioners should connect to the local IP address of the instance.
## User Data
The available variables are:
- `HTTPIP` and `HTTPPort` - The IP and port, respectively of an HTTP server
that is started serving the directory specified by the `http_directory`
configuration parameter. If `http_directory` isn't specified, these will be
blank. Example: `{{.HTTPIP}}:{{.HTTPPort}}/path/to/a/file/in/http_directory`
## Basic Example
Here is a basic example.
```json
{
"type": "cloudstack",
"api_url": "https://cloudstack.company.com/client/api",
"api_key": "YOUR_API_KEY",
"secret_key": "YOUR_SECRET_KEY",
"disk_offering": "Small - 20GB",
"hypervisor": "KVM",
"network": "management",
"service_offering": "small",
"source_iso": "CentOS-7.0-1406-x86_64-Minimal",
"zone": "NL1",
"ssh_username": "root",
"template_name": "Centos7-x86_64-KVM-Packer",
"template_display_text": "Centos7-x86_64 KVM Packer",
"template_featured": true,
"template_password_enabled": true,
"template_scalable": true,
"template_os": "Other PV (64-bit)"
}
```

View File

@ -0,0 +1,16 @@
---
description: |
Community-maintained builders are not part of the core Packer binary, but
can run alongside Packer with minimal extra effort.
layout: docs
page_title: Community - Builders
sidebar_title: Community-Supported
---
# Community Builders
The following builders are developed and maintained by various members of the
Packer community, not by HashiCorp. For more information on how to use community
builders, see our docs on [extending Packer](/docs/extending).
@include 'builders/community_builders.mdx'

Some files were not shown because too many files have changed in this diff Show More