run docs through pandoc

This commit is contained in:
Matthew Hooker
2017-06-14 18:13:46 -07:00
parent 3a579bea81
commit bcc0d24bf4
92 changed files with 2940 additions and 2989 deletions
+4 -1
View File
@@ -60,6 +60,9 @@ fmt: ## Format Go code
fmt-check: ## Check go code formatting
$(CURDIR)/scripts/gofmtcheck.sh $(GOFMT_FILES)
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 {} \;
# Install js-beautify with npm install -g js-beautify
fmt-examples:
find examples -name *.json | xargs js-beautify -r -s 2 -n -eol "\n"
@@ -91,4 +94,4 @@ updatedeps:
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: bin checkversion ci default deps fmt fmt-examples generate releasebin test testacc testrace updatedeps
.PHONY: bin checkversion ci default deps fmt fmt-docs fmt-examples generate releasebin test testacc testrace updatedeps
+36 -36
View File
@@ -1,12 +1,12 @@
---
description: |
There are a handful of terms used throughout the Packer documentation where
the meaning may not be immediately obvious if you haven't used Packer before.
Luckily, there are relatively few. This page documents all the terminology
required to understand and use Packer. The terminology is in alphabetical
order for quick referencing.
layout: docs
page_title: Terminology
description: |-
There are a handful of terms used throughout the Packer documentation where
the meaning may not be immediately obvious if you haven't used Packer before.
Luckily, there are relatively few. This page documents all the terminology
required to understand and use Packer. The terminology is in alphabetical
order for quick referencing.
---
# Packer Terminology
@@ -17,39 +17,39 @@ Luckily, there are relatively few. This page documents all the terminology
required to understand and use Packer. The terminology is in alphabetical order
for quick referencing.
- `Artifacts` are the results of a single build, and are usually a set of IDs or
files to represent a machine image. Every builder produces a single artifact.
As an example, in the case of the Amazon EC2 builder, the artifact is a set of
AMI IDs (one per region). For the VMware builder, the artifact is a directory
of files comprising the created virtual machine.
- `Artifacts` are the results of a single build, and are usually a set of IDs or
files to represent a machine image. Every builder produces a single artifact.
As an example, in the case of the Amazon EC2 builder, the artifact is a set of
AMI IDs (one per region). For the VMware builder, the artifact is a directory
of files comprising the created virtual machine.
- `Builds` are a single task that eventually produces an image for a single
platform. Multiple builds run in parallel. Example usage in a sentence: "The
Packer build produced an AMI to run our web application." Or: "Packer is
running the builds now for VMware, AWS, and VirtualBox."
- `Builds` are a single task that eventually produces an image for a single
platform. Multiple builds run in parallel. Example usage in a sentence: "The
Packer build produced an AMI to run our web application." Or: "Packer is
running the builds now for VMware, AWS, and VirtualBox."
- `Builders` are components of Packer that are able to create a machine image
for a single platform. Builders read in some configuration and use that to run
and generate a machine image. A builder is invoked as part of a build in order
to create the actual resulting images. Example builders include VirtualBox,
VMware, and Amazon EC2. Builders can be created and added to Packer in the
form of plugins.
- `Builders` are components of Packer that are able to create a machine image
for a single platform. Builders read in some configuration and use that to run
and generate a machine image. A builder is invoked as part of a build in order
to create the actual resulting images. Example builders include VirtualBox,
VMware, and Amazon EC2. Builders can be created and added to Packer in the
form of plugins.
- `Commands` are sub-commands for the `packer` program that perform some job. An
example command is "build", which is invoked as `packer build`. Packer ships
with a set of commands out of the box in order to define its command-line
interface.
- `Commands` are sub-commands for the `packer` program that perform some job. An
example command is "build", which is invoked as `packer build`. Packer ships
with a set of commands out of the box in order to define its command-line
interface.
- `Post-processors` are components of Packer that take the result of a builder
or another post-processor and process that to create a new artifact. Examples
of post-processors are compress to compress artifacts, upload to upload
artifacts, etc.
- `Post-processors` are components of Packer that take the result of a builder
or another post-processor and process that to create a new artifact. Examples
of post-processors are compress to compress artifacts, upload to upload
artifacts, etc.
- `Provisioners` are components of Packer that install and configure software
within a running machine prior to that machine being turned into a static
image. They perform the major work of making the image contain useful
software. Example provisioners include shell scripts, Chef, Puppet, etc.
- `Provisioners` are components of Packer that install and configure software
within a running machine prior to that machine being turned into a static
image. They perform the major work of making the image contain useful
software. Example provisioners include shell scripts, Chef, Puppet, etc.
- `Templates` are JSON files which define one or more builds by configuring the
various components of Packer. Packer is able to read a template and use that
information to create multiple machine images in parallel.
- `Templates` are JSON files which define one or more builds by configuring the
various components of Packer. Packer is able to read a template and use that
information to create multiple machine images in parallel.
+108 -113
View File
@@ -4,7 +4,7 @@ description: |
customized images based on an existing base images.
layout: docs
page_title: Alicloud Image Builder
...
---
# Alicloud Image Builder
@@ -22,174 +22,170 @@ builder.
### Required:
- `access_key` (string) - This is the Alicloud access key. It must be provided,
but it can also be sourced from the `ALICLOUD_ACCESS_KEY` environment
variable.
- `access_key` (string) - This is the Alicloud access key. It must be provided,
but it can also be sourced from the `ALICLOUD_ACCESS_KEY` environment
variable.
- `secret_key` (string) - This is the Alicloud secret key. It must be provided,
but it can also be sourced from the `ALICLOUD_SECRET_KEY` environment
variable.
- `secret_key` (string) - This is the Alicloud secret key. It must be provided,
but it can also be sourced from the `ALICLOUD_SECRET_KEY` environment
variable.
- `region` (string) - This is the Alicloud region. It must be provided, but it
can also be sourced from the `ALICLOUD_REGION` environment variables.
- `region` (string) - This is the Alicloud region. It must be provided, but it
can also be sourced from the `ALICLOUD_REGION` environment variables.
- `instance_type` (string) - Type of the instance. For values, see [Instance
Type Table](). You can also obtain the latest instance type table by invoking
the [Querying Instance Type
Table](https://intl.aliyun.com/help/doc-detail/25620.htm?spm=a3c0i.o25499en.a3.6.Dr1bik)
interface.
- `image_name` (string) - 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://`.
- `source_image` (string) - This is the base image id which you want to create
your customized images.
- `instance_type` (string) - Type of the instance. For values, see [Instance
Type Table](). You can also obtain the latest instance type table by invoking
the [Querying Instance Type
Table](https://intl.aliyun.com/help/doc-detail/25620.htm?spm=a3c0i.o25499en.a3.6.Dr1bik)
interface.
- `image_name` (string) - 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://`.
- `source_image` (string) - This is the base image id which you want to create
your customized images.
### Optional:
- `skip_region_validation` (bool) - The region validation can be skipped if this
value is true, the default value is false.
- `skip_region_validation` (bool) - The region validation can be skipped if this
value is true, the default value is false.
- `image_description` (string) - 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://.
- `image_description` (string) - 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://`.
- `image_version` (string) - The version number of the image, with a length limit
of 1 to 40 English characters.
- `image_version` (string) - The version number of the image, with a length limit
of 1 to 40 English characters.
- `image_share_account` (array of string) - The IDs of to-be-added Aliyun
accounts to which the image is shared. The number of accounts is 1 to 10. If
number of accounts is greater than 10, this parameter is ignored.
- `image_share_account` (array of string) - The IDs of to-be-added Aliyun
accounts to which the image is shared. The number of accounts is 1 to 10. If
number of accounts is greater than 10, this parameter is ignored.
- `image_copy_regions` (array of string) - Copy to the destination regionIds.
- `image_copy_regions` (array of string) - Copy to the destination regionIds.
- `image_copy_names` (array of string) - 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://`.
- `image_copy_names` (array of string) - 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://`.
- `image_force_delete` (bool) - If this value is true, when the target image name
is duplicated with an existing image, it will delete the existing image and
then create the target image, otherwise, the creation will fail. The default
value is false.
- `image_force_delete` (bool) - If this value is true, when the target image name
is duplicated with an existing image, it will delete the existing image and
then create the target image, otherwise, the creation will fail. The default
value is false.
- `image_force_delete_snapshots` (bool) - If this value is true, when delete the
duplicated existing image, the source snapshot of this image will be delete
either.
- `image_force_delete_snapshots` (bool) - If this value is true, when delete the
duplicated existing image, the source snapshot of this image will be delete
either.
- `disk_name` (string) - The value of disk name is blank by default. [2, 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://.
- `disk_name` (string) - The value of disk name is blank by default. \[2, 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://`.
- `disk_category` (string) - Category of the data disk. Optional values are:
- cloud - general cloud disk
- cloud_efficiency - efficiency cloud disk
- cloud_ssd - cloud SSD
- `disk_category` (string) - Category of the data disk. Optional values are:
- cloud - general cloud disk
- cloud\_efficiency - efficiency cloud disk
- cloud\_ssd - cloud SSD
Default value: cloud.
- `disk_size` (int) - Size of the system disk, in GB, values range:
- cloud - 5 ~ 2000
- cloud_efficiency - 20 ~ 2048
- cloud_ssd - 20 ~ 2048
- `disk_size` (int) - Size of the system disk, in GB, values range:
- cloud - 5 ~ 2000
- cloud\_efficiency - 20 ~ 2048
- cloud\_ssd - 20 ~ 2048
The value should be equal to or greater than the size of the specific SnapshotId.
- `disk_snapshot_id` (string) - Snapshots are used to create the data disk
After this parameter is specified, Size is ignored. The actual size of the
created disk is the size of the specified snapshot.
- `disk_snapshot_id` (string) - Snapshots are used to create the data disk
After this parameter is specified, Size is ignored. The actual size of the
created disk is the size of the specified snapshot.
Snapshots from on or before July 15, 2013 cannot be used to create a disk.
- `disk_description` (string) - 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://.
- `disk_description` (string) - 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://`.
- `disk_delete_with_instance` (string) - Whether or not the disk is released along with the instance:
- True indicates that when the instance is released, this disk will be released with it
- False indicates that when the instance is released, this disk will be retained.
- `disk_delete_with_instance` (string) - Whether or not the disk is released along with the instance:
- True indicates that when the instance is released, this disk will be released with it
- False indicates that when the instance is released, this disk will be retained.
- `disk_device` (string) - Device information of the related instance: such as
`/dev/xvdb` It is null unless the Status is In_use.
- `disk_device` (string) - Device information of the related instance: such as
`/dev/xvdb` It is null unless the Status is In\_use.
- `zone_id` (string) - ID of the zone to which the disk belongs.
- `zone_id` (string) - ID of the zone to which the disk belongs.
- `io_optimized` (string) - I/O optimized. Optional values are:
- none: none I/O Optimized
- optimized: I/O Optimized
- `io_optimized` (string) - I/O optimized. Optional values are:
- none: none I/O Optimized
- optimized: I/O Optimized
Default value: none for Generation I instances; optimized for other instances.
- `force_stop_instance` (bool) - Whether to force shutdown upon device restart.
The default value is `false`.
- `force_stop_instance` (bool) - Whether to force shutdown upon device restart.
The default value is `false`.
If it is set to `false`, the system is shut down normally; if it is set to
`true`, the system is forced to shut down.
- `security_group_id` (string) - ID of the security group to which a newly
created instance belongs. Mutual access is allowed between instances in one
security group. If not specified, the newly created instance will be added to
the default security group. If the default group doesn’t exist, or the number
of instances in it has reached the maximum limit, a new security group will
be created automatically.
- `security_group_id` (string) - ID of the security group to which a newly
created instance belongs. Mutual access is allowed between instances in one
security group. If not specified, the newly created instance will be added to
the default security group. If the default group doesn’t exist, or the number
of instances in it has reached the maximum limit, a new security group will
be created automatically.
- `security_group_name` (string) - 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://`.
- `security_group_name` (string) - 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://`.
- `user_data` (string) - The UserData of an instance must be encoded in `Base64`
format, and the maximum size of the raw data is `16 KB`.
- `user_data` (string) - The UserData of an instance must be encoded in `Base64`
format, and the maximum size of the raw data is `16 KB`.
- `user_data_file` (string) - The file name of the userdata.
- `user_data_file` (string) - The file name of the userdata.
- `vpc_id` (string) - VPC ID allocated by the system.
- `vpc_id` (string) - VPC ID allocated by the system.
- `vpc_name` (string) - 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://`.
- `vpc_name` (string) - 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://`.
- `vpc_cidr_block` (string) - 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`.
- `vpc_cidr_block` (string) - 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`.
- `vswitch_id` (string) - The ID of the VSwitch to be used.
- `vswitch_id` (string) - The ID of the VSwitch to be used.
- `instance_name` (string) - Display name of the instance, which is a string of
2 to 128 Chinese or English characters. It must begin with an
uppercase/lowercase letter or a Chinese character and can contain numerals,
`.`, `_`, or `-`. The instance name is displayed on the Alibaba Cloud
console. If this parameter is not specified, the default value is InstanceId
of the instance. It cannot begin with http:// or https://.
- `instance_name` (string) - Display name of the instance, which is a string of
2 to 128 Chinese or English characters. It must begin with an
uppercase/lowercase letter or a Chinese character and can contain numerals,
`.`, `_`, or `-`. The instance name is displayed on the Alibaba Cloud
console. If this parameter is not specified, the default value is InstanceId
of the instance. It cannot begin with `http://` or `https://`.
- `internet_charge_type` (string) - Internet charge type, which can be
`PayByTraffic` or `PayByBandwidth`. Optional values:
- PayByBandwidth
- PayByTraffic
- `internet_charge_type` (string) - Internet charge type, which can be
`PayByTraffic` or `PayByBandwidth`. Optional values:
- PayByBandwidth
- PayByTraffic
If this parameter is not specified, the default value is `PayByBandwidth`.
- `internet_max_bandwidth_out` (string) - Maximum outgoing bandwidth to the public
network, measured in Mbps (Mega bit per second).
- `internet_max_bandwidth_out` (string) - Maximum outgoing bandwidth to the public
network, measured in Mbps (Mega bit per second).
Value range:
- PayByBandwidth: [0, 100]. If this parameter is not specified, API automatically sets it to 0 Mbps.
- PayByTraffic: [1, 100]. If this parameter is not specified, an error is returned.
- `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 `<UUID>` is a 36 character unique identifier.
- PayByBandwidth: \[0, 100\]. If this parameter is not specified, API automatically sets it to 0 Mbps.
- PayByTraffic: \[1, 100\]. If this parameter is not specified, an error is returned.
- `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 `<UUID>` is a 36 character unique identifier.
## Basic Example
Here is a basic example for Alicloud.
```json
``` json
{
"variables": {
"access_key": "{{env `ALICLOUD_ACCESS_KEY`}}",
@@ -217,7 +213,6 @@ Here is a basic example for Alicloud.
}
```
See the
[examples/alicloud](https://github.com/hashicorp/packer/tree/master/examples/alicloud)
folder in the packer project for more examples.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+13 -13
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.
layout: docs
sidebar_current: docs-builders-amazon
page_title: Amazon AMI - Builders
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.
page_title: 'Amazon AMI - Builders'
sidebar_current: 'docs-builders-amazon'
---
# Amazon AMI Builder
@@ -34,7 +34,7 @@ Packer supports the following builders at the moment:
not require running in AWS. This is an **advanced builder and should not be
used by newcomers**.
-> **Don't know which builder to use?** If in doubt, use the [amazon-ebs
-&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
generally recommends EBS-backed images nowadays.
@@ -72,12 +72,12 @@ Credentials are resolved in the following order:
Packer depends on the [AWS
SDK](https://aws.amazon.com/documentation/sdk-for-go/) to perform automatic
lookup using _credential chains_. In short, the SDK looks for credentials in
lookup using *credential chains*. In short, the SDK looks for credentials in
the following order:
1. Environment variables.
2. Shared credentials file.
3. If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2.
1. Environment variables.
2. Shared credentials file.
3. If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2.
Please refer to the SDK's documentation on [specifying
credentials](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials)
@@ -93,7 +93,7 @@ the task's or instance's IAM role, if it has one.
The following policy document provides the minimal set permissions necessary for
Packer to work:
```json
``` json
{
"Version": "2012-10-17",
"Statement": [{
@@ -152,7 +152,7 @@ The example policy below may help packer work with IAM roles. Note that this
example provides more than the minimal set of permissions needed for packer to
work, but specifics will depend on your use-case.
```json
``` json
{
"Sid": "PackerIAMPassRole",
"Effect": "Allow",
@@ -173,6 +173,6 @@ 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
<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`.
@@ -1,35 +1,35 @@
---
description: |
In order to build VMs in Azure, Packer needs various configuration options.
These options and how to obtain them are documented on this page.
layout: docs
sidebar_current: docs-builders-azure-setup
page_title: Setup - Azure - Builders
description: |-
In order to build VMs in Azure, Packer needs various configuration options.
These options and how to obtain them are documented on this page.
page_title: 'Setup - Azure - Builders'
sidebar_current: 'docs-builders-azure-setup'
---
# Authorizing Packer Builds in Azure
In order to build VMs in Azure Packer needs 6 configuration options to be specified:
- `subscription_id` - UUID identifying your Azure subscription (where billing is handled)
- `subscription_id` - UUID identifying your Azure subscription (where billing is handled)
- `client_id` - UUID identifying the Active Directory service principal that will run your Packer builds
- `client_id` - UUID identifying the Active Directory service principal that will run your Packer builds
- `client_secret` - service principal secret / password
- `client_secret` - service principal secret / password
- `object_id` - service principal object id (OSType = Windows Only)
- `object_id` - service principal object id (OSType = Windows Only)
- `resource_group_name` - name of the resource group where your VHD(s) will be stored
- `resource_group_name` - name of the resource group where your VHD(s) will be stored
- `storage_account` - name of the storage account where your VHD(s) will be stored
- `storage_account` - name of the storage account where your VHD(s) will be stored
-> Behind the scenes Packer uses the OAuth protocol to authenticate against Azure Active Directory and authorize requests to the Azure Service Management API. These topics are unnecessarily complicated so we will try to ignore them for the rest of this document.<br /><br />You do not need to understand how OAuth works in order to use Packer with Azure, though the Active Directory terms "service principal" and "role" will be useful for understanding Azure's access policies.
-&gt; Behind the scenes Packer uses the OAuth protocol to authenticate against Azure Active Directory and authorize requests to the Azure Service Management API. These topics are unnecessarily complicated so we will try to ignore them for the rest of this document.<br /><br />You do not need to understand how OAuth works in order to use Packer with Azure, though the Active Directory terms "service principal" and "role" will be useful for understanding Azure's access policies.
In order to get all of the items above, you will need a username and password for your Azure account.
## Device Login
Device login is an alternative way to authorize in Azure Packer. Device login only requires you to know your
Device login is an alternative way to authorize in Azure Packer. Device login only requires you to know your
Subscription ID. (Device login is only supported for Linux based VMs.) Device login is intended for those who are first
time users, and just want to ''kick the tires.'' We recommend the SPN approach if you intend to automate Packer, or for
deploying Windows VMs.
@@ -38,26 +38,26 @@ deploying Windows VMs.
There are three pieces of information you must provide to enable device login mode.
1. SubscriptionID
1. Resource Group - parent resource group that Packer uses to build an image.
1. Storage Account - storage account where the image will be placed.
1. SubscriptionID
2. Resource Group - parent resource group that Packer uses to build an image.
3. Storage Account - storage account where the image will be placed.
> Device login mode is enabled by not setting client_id and client_secret.
> Device login mode is enabled by not setting client\_id and client\_secret.
The device login flow asks that you open a web browser, navigate to http://aka.ms/devicelogin, and input the supplied
The device login flow asks that you open a web browser, navigate to <http://aka.ms/devicelogin>, and input the supplied
code. This authorizes the Packer for Azure application to act on your behalf. An OAuth token will be created, and stored
in the user's home directory (~/.azure/packer/oauth-TenantID.json). This token is used if the token file exists, and it
is refreshed as necessary. The token file prevents the need to continually execute the device login flow.
is refreshed as necessary. The token file prevents the need to continually execute the device login flow.
## Install the Azure CLI
To get the credentials above, we will need to install the Azure CLI. Please refer to Microsoft's official [installation guide](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/).
-> The guides below also use a tool called [`jq`](https://stedolan.github.io/jq/) to simplify the output from the Azure CLI, though this is optional. If you use homebrew you can simply `brew install node jq`.
-&gt; The guides below also use a tool called [`jq`](https://stedolan.github.io/jq/) to simplify the output from the Azure CLI, though this is optional. If you use homebrew you can simply `brew install node jq`.
If you already have node.js installed you can use `npm` to install `azure-cli`:
```shell
``` shell
$ npm install -g azure-cli --no-progress
```
@@ -73,26 +73,24 @@ If you want more control or the script does not work for you, you can also use t
Login using the Azure CLI
```shell
``` shell
$ azure config mode arm
$ azure login -u USERNAME
```
Get your account information
```shell
``` shell
$ azure account list --json | jq -r '.[].name'
$ azure account set ACCOUNTNAME
$ azure account show --json | jq -r ".[] | .id"
```
-> Throughout this document when you see a command pipe to `jq` you may instead omit `--json` and everything after it, but the output will be more verbose. For example you can simply run `azure account list` instead.
-&gt; Throughout this document when you see a command pipe to `jq` you may instead omit `--json` and everything after it, but the output will be more verbose. For example you can simply run `azure account list` instead.
This will print out one line that look like this:
```
4f562e88-8caf-421a-b4da-e3f6786c52ec
```
4f562e88-8caf-421a-b4da-e3f6786c52ec
This is your `subscription_id`. Note it for later.
@@ -100,7 +98,7 @@ This is your `subscription_id`. Note it for later.
A [resource group](https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/#resource-groups) is used to organize related resources. Resource groups and storage accounts are tied to a location. To see available locations, run:
```shell
``` shell
$ azure location list
# ...
@@ -113,7 +111,7 @@ Your storage account (below) will need to use the same `GROUPNAME` and `LOCATION
We will need to create a storage account where your Packer artifacts will be stored. We will create a `LRS` storage account which is the least expensive price/GB at the time of writing.
```shell
``` shell
$ azure storage account create \
-g GROUPNAME \
-l LOCATION \
@@ -121,7 +119,7 @@ $ azure storage account create \
--kind storage STORAGENAME
```
-> `LRS` is meant as a literal "LRS" and not as a variable.
-&gt; `LRS` is meant as a literal "LRS" and not as a variable.
Make sure that `GROUPNAME` and `LOCATION` are the same as above.
@@ -129,7 +127,7 @@ Make sure that `GROUPNAME` and `LOCATION` are the same as above.
An application represents a way to authorize access to the Azure API. Note that you will need to specify a URL for your application (this is intended to be used for OAuth callbacks) but these do not actually need to be valid URLs.
```shell
``` shell
$ azure ad app create \
-n APPNAME \
-i APPURL \
@@ -145,7 +143,7 @@ You cannot directly grant permissions to an application. Instead, you create a s
First, get the `APPID` for the application we just created.
```shell
``` shell
$ azure ad app list --json \
| jq '.[] | select(.displayName | contains("APPNAME")) | .appId'
# ...
@@ -157,7 +155,7 @@ $ azure ad sp create --applicationId APPID
Finally, we will associate the proper permissions with our application's service principal. We're going to assign the `Owner` role to our Packer application and change the scope to manage our whole subscription. (The `Owner` role can be scoped to a specific resource group to further reduce the scope of the account.) This allows Packer to create temporary resource groups for each build.
```shell
``` shell
$ azure role assignment create \
--spn APPURL \
-o "Owner" \
@@ -166,26 +164,25 @@ $ azure role assignment create \
There are a lot of pre-defined roles and you can define your own with more granular permissions, though this is out of scope. You can see a list of pre-configured roles via:
```shell
``` shell
$ azure role list --json \
| jq ".[] | {name:.Name, description:.Description}"
```
### Configuring Packer
Now (finally) everything has been setup in Azure. Let's get our configuration keys together:
Get `subscription_id`:
```shell
``` shell
$ azure account show --json \
| jq ".[] | .id"
```
Get `client_id`
```shell
``` shell
$ azure ad app list --json \
| jq '.[] | select(.displayName | contains("APPNAME")) | .appId'
```
@@ -196,18 +193,18 @@ This cannot be retrieved. If you forgot this, you will have to delete and re-cre
Get `object_id` (OSTYpe=Windows only)
```shell
``` shell
azure ad sp show -n CLIENT_ID
```
Get `resource_group_name`
```shell
``` shell
$ azure group list
```
Get `storage_account`
```shell
``` shell
$ azure storage account list
```
File diff suppressed because it is too large Load Diff
+37 -37
View File
@@ -1,12 +1,12 @@
---
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
sidebar_current: docs-builders-cloudstack
page_title: CloudStack - Builders
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.
page_title: 'CloudStack - Builders'
sidebar_current: 'docs-builders-cloudstack'
---
# CloudStack Builder
@@ -33,101 +33,101 @@ builder.
### Required:
- `api_url` (string) - The CloudStack API endpoint we will connect to.
- `api_url` (string) - The CloudStack API endpoint we will connect to.
- `api_key` (string) - The API key used to sign all API requests.
- `api_key` (string) - The API key used to sign all API requests.
- `cidr_list` (array) - List of CIDR's that will have access to the new
- `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. Usually this will be the NAT address of your
current location. Only required when `use_local_ip_address` is `false`.
- `instance_name` (string) - The name of the instance. Defaults to
- `instance_name` (string) - The name of the instance. Defaults to
"packer-UUID" where UUID is dynamically generated.
- `network` (string) - The name or ID of the network to connect the instance
- `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.
- `secret_key` (string) - The secret key used to sign all API requests.
- `service_offering` (string) - The name or ID of the service offering used
- `service_offering` (string) - The name or ID of the service offering used
for the instance.
- `soure_iso` (string) - The name or ID of an ISO that will be mounted before
- `soure_iso` (string) - The name or ID of an ISO that will be mounted before
booting the instance. This option is mutual exclusive with `source_template`.
- `source_template` (string) - The name or ID of the template used as base
- `source_template` (string) - The name or ID of the template used as base
template for the instance. This option is mutual explusive with `source_iso`.
- `template_name` (string) - The name of the new template. Defaults to
- `template_name` (string) - The name of the new template. Defaults to
"packer-{{timestamp}}" where timestamp will be the current time.
- `template_display_text` (string) - The display text of the new template.
- `template_display_text` (string) - The display text of the new template.
Defaults to the `template_name`.
- `template_os` (string) - The name or ID of the template OS for the new
- `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
- `zone` (string) - The name or ID of the zone where the instance will be
created.
### Optional:
- `async_timeout` (int) - The time duration to wait for async calls to
- `async_timeout` (int) - The time duration to wait for async calls to
finish. Defaults to 30m.
- `disk_offering` (string) - The name or ID of the disk offering used for the
- `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` (int) - The size (in GB) of the root disk of the new instance.
- `disk_size` (int) - The size (in GB) of the root disk of the new instance.
This option is only available when using `source_template`.
- `http_get_only` (boolean) - Some cloud providers only allow HTTP GET calls to
- `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.
- `hypervisor` (string) - The target hypervisor (e.g. `XenServer`, `KVM`) for
- `hypervisor` (string) - The target hypervisor (e.g. `XenServer`, `KVM`) for
the new template. This option is required when using `source_iso`.
- `keypair` (string) - The name of the SSH key pair that will be used to
- `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.
- `project` (string) - The name or ID of the project to deploy the instance to.
- `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
- `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.
- `ssl_no_verify` (boolean) - Set to `true` to skip SSL verification. Defaults
- `ssl_no_verify` (boolean) - Set to `true` to skip SSL verification. Defaults
to `false`.
- `template_featured` (boolean) - Set to `true` to indicate that the template
- `template_featured` (boolean) - Set to `true` to indicate that the template
is featured. Defaults to `false`.
- `template_public` (boolean) - Set to `true` to indicate that the template is
- `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
- `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
- `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
- `template_scalable` (boolean) - Set to `true` to indicate that the template
contains tools to support dynamic scaling of VM cpu/memory. Defaults to `false`.
- `user_data` (string) - User data to launch with the instance.
- `user_data` (string) - User data to launch with the instance.
- `use_local_ip_address` (boolean) - Set to `true` to indicate that the
- `use_local_ip_address` (boolean) - Set to `true` to indicate that the
provisioners should connect to the local IP address of the instance.
## Basic Example
Here is a basic example.
```json
``` json
{
"type": "cloudstack",
"api_url": "https://cloudstack.company.com/client/api",
+6 -6
View File
@@ -1,11 +1,11 @@
---
description: |
Packer is extensible, allowing you to write new builders without having to
modify the core source code of Packer itself. Documentation for creating new
builders is covered in the custom builders page of the Packer plugin section.
layout: docs
sidebar_current: docs-builders-custom
page_title: Custom - Builders
description: |-
Packer is extensible, allowing you to write new builders without having to
modify the core source code of Packer itself. Documentation for creating new
builders is covered in the custom builders page of the Packer plugin section.
page_title: 'Custom - Builders'
sidebar_current: 'docs-builders-custom'
---
# Custom Builder
@@ -1,16 +1,15 @@
---
description: |
The digitalocean Packer builder is able to create new images for use with
DigitalOcean. The builder takes a source image, runs any provisioning
necessary on the image after launching it, then snapshots it into a reusable
image. This reusable image can then be used as the foundation of new servers
that are launched within DigitalOcean.
layout: docs
sidebar_current: docs-builders-digitalocean
page_title: DigitalOcean - Builders
description: |-
The digitalocean Packer builder is able to create new images for use with
DigitalOcean. The builder takes a source image, runs any provisioning
necessary on the image after launching it, then snapshots it into a reusable
image. This reusable image can then be used as the foundation of new servers
that are launched within DigitalOcean.
page_title: 'DigitalOcean - Builders'
sidebar_current: 'docs-builders-digitalocean'
---
# DigitalOcean Builder
Type: `digitalocean`
@@ -36,63 +35,62 @@ builder.
### Required:
- `api_token` (string) - The client TOKEN to use to access your account. It
- `api_token` (string) - The client TOKEN to use to access your account. It
can also be specified via environment variable `DIGITALOCEAN_API_TOKEN`,
if set.
- `image` (string) - The name (or slug) of the base image to use. This is the
- `image` (string) - The name (or slug) of the base image to use. This is the
image that will be used to launch a new droplet and provision it. See
[https://developers.digitalocean.com/documentation/v2/\#list-all-images](https://developers.digitalocean.com/documentation/v2/#list-all-images) for
<https://developers.digitalocean.com/documentation/v2/#list-all-images> for
details on how to get a list of the accepted image names/slugs.
- `region` (string) - The name (or slug) of the region to launch the
- `region` (string) - The name (or slug) of the region to launch the
droplet in. Consequently, this is the region where the snapshot will
be available. See
[https://developers.digitalocean.com/documentation/v2/\#list-all-regions](https://developers.digitalocean.com/documentation/v2/#list-all-regions) for
<https://developers.digitalocean.com/documentation/v2/#list-all-regions> for
the accepted region names/slugs.
- `size` (string) - The name (or slug) of the droplet size to use. See
[https://developers.digitalocean.com/documentation/v2/\#list-all-sizes](https://developers.digitalocean.com/documentation/v2/#list-all-sizes) for
- `size` (string) - The name (or slug) of the droplet size to use. See
<https://developers.digitalocean.com/documentation/v2/#list-all-sizes> for
the accepted size names/slugs.
### Optional:
- `api_url` (string) - Non standard api endpoint URL. Set this if you are
- `api_url` (string) - Non standard api endpoint URL. Set this if you are
using a DigitalOcean API compatible service. It can also be specified via
environment variable `DIGITALOCEAN_API_URL`.
- `droplet_name` (string) - The name assigned to the droplet. DigitalOcean
- `droplet_name` (string) - The name assigned to the droplet. DigitalOcean
sets the hostname of the machine to this value.
- `private_networking` (boolean) - Set to `true` to enable private networking
- `private_networking` (boolean) - Set to `true` to enable private networking
for the droplet being created. This defaults to `false`, or not enabled.
- `monitoring` (boolean) - Set to `true` to enable monitoring
- `monitoring` (boolean) - Set to `true` to enable monitoring
for the droplet being created. This defaults to `false`, or not enabled.
- `snapshot_name` (string) - The name of the resulting snapshot that will
- `snapshot_name` (string) - The name of the resulting snapshot that will
appear in your account. This must be unique. To help make this unique, use a
function like `timestamp` (see [configuration
templates](/docs/templates/engine.html) for more info)
- `snapshot_regions` (array of strings) - The regions of the resulting snapshot that will
- `snapshot_regions` (array of strings) - The regions of the resulting snapshot that will
appear in your account.
- `state_timeout` (string) - The time to wait, as a duration string, for a
- `state_timeout` (string) - The time to wait, as a duration string, for a
droplet to enter a desired state (such as "active") before timing out. The
default state timeout is "6m".
- `user_data` (string) - User data to launch with the Droplet.
- `user_data_file` (string) - Path to a file that will be used for the user
- `user_data` (string) - User data to launch with the Droplet.
- `user_data_file` (string) - Path to a file that will be used for the user
data when launching the Droplet.
## Basic Example
Here is a basic example. It is completely valid as soon as you enter your own
access tokens:
```json
``` json
{
"type": "digitalocean",
"api_token": "YOUR API KEY",
+67 -67
View File
@@ -1,11 +1,11 @@
---
description: |
The docker Packer builder builds Docker images using Docker. The builder
starts a Docker container, runs provisioners within this container, then
exports the container for reuse or commits the image.
layout: docs
sidebar_current: docs-builders-docker
page_title: Docker - Builders
description: |-
The docker Packer builder builds Docker images using Docker. The builder
starts a Docker container, runs provisioners within this container, then
exports the container for reuse or commits the image.
page_title: 'Docker - Builders'
sidebar_current: 'docs-builders-docker'
---
# Docker Builder
@@ -33,7 +33,7 @@ what [platforms Docker supports and how to install onto them](https://docs.docke
Below is a fully functioning example. It doesn't do anything useful, since no
provisioners are defined, but it will effectively repackage an image.
```json
``` json
{
"type": "docker",
"image": "ubuntu",
@@ -47,7 +47,7 @@ Below is another example, the same as above but instead of exporting the running
container, this one commits the container to an image. The image can then be
more easily tagged, pushed, etc.
```json
``` json
{
"type": "docker",
"image": "ubuntu",
@@ -66,7 +66,7 @@ Docker](https://docs.docker.com/engine/reference/commandline/commit/).
Example uses of all of the options, assuming one is building an NGINX image
from ubuntu as an simple example:
```json
``` json
{
"type": "docker",
"image": "ubuntu",
@@ -88,37 +88,37 @@ from ubuntu as an simple example:
Allowed metadata fields that can be changed are:
- CMD
- String, supports both array (escaped) and string form
- EX: `"CMD [\"nginx\", \"-g\", \"daemon off;\"]"`
- EX: `"CMD nginx -g daemon off;"`
- ENTRYPOINT
- String
- EX: `"ENTRYPOINT /var/www/start.sh"`
- ENV
- String, note there is no equal sign:
- EX: `"ENV HOSTNAME www.example.com"` not `"ENV HOSTNAME=www.example.com"`
- EXPOSE
- String, space separated ports
- EX: `"EXPOSE 80 443"`
- LABEL
- String, space separated key=value pairs
- EX: `"LABEL version=1.0"`
- ONBUILD
- String
- EX: `"ONBUILD RUN date"`
- MAINTAINER
- String, deprecated in Docker version 1.13.0
- EX: `"MAINTAINER NAME"`
- USER
- String
- EX: `"USER USERNAME"`
- VOLUME
- String
- EX: `"VOLUME FROM TO"`
- WORKDIR
- String
- EX: `"WORKDIR PATH"`
- CMD
- String, supports both array (escaped) and string form
- EX: `"CMD [\"nginx\", \"-g\", \"daemon off;\"]"`
- EX: `"CMD nginx -g daemon off;"`
- ENTRYPOINT
- String
- EX: `"ENTRYPOINT /var/www/start.sh"`
- ENV
- String, note there is no equal sign:
- EX: `"ENV HOSTNAME www.example.com"` not `"ENV HOSTNAME=www.example.com"`
- EXPOSE
- String, space separated ports
- EX: `"EXPOSE 80 443"`
- LABEL
- String, space separated key=value pairs
- EX: `"LABEL version=1.0"`
- ONBUILD
- String
- EX: `"ONBUILD RUN date"`
- MAINTAINER
- String, deprecated in Docker version 1.13.0
- EX: `"MAINTAINER NAME"`
- USER
- String
- EX: `"USER USERNAME"`
- VOLUME
- String
- EX: `"VOLUME FROM TO"`
- WORKDIR
- String
- EX: `"WORKDIR PATH"`
## Configuration Reference
@@ -134,40 +134,40 @@ builder.
You must specify (only) one of `commit`, `discard`, or `export_path`.
- `commit` (boolean) - If true, the container will be committed to an image
- `commit` (boolean) - If true, the container will be committed to an image
rather than exported.
- `discard` (boolean) - Throw away the container when the build is complete.
- `discard` (boolean) - 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).
- `export_path` (string) - The path where the final container will be exported
- `export_path` (string) - The path where the final container will be exported
as a tar file.
- `image` (string) - The base image for the Docker container that will
- `image` (string) - The base image for the Docker container that will
be started. This image will be pulled from the Docker registry if it doesn't
already exist.
### Optional:
- `author` (string) - Set the author (e-mail) of a commit.
- `author` (string) - Set the author (e-mail) of a commit.
- `aws_access_key` (string) - The AWS access key used to communicate with AWS.
- `aws_access_key` (string) - The AWS access key used to communicate with AWS.
[Learn how to set this.](/docs/builders/amazon.html#specifying-amazon-credentials)
- `aws_secret_key` (string) - The AWS secret key used to communicate with AWS.
- `aws_secret_key` (string) - The AWS secret key used to communicate with AWS.
[Learn how to set this.](/docs/builders/amazon.html#specifying-amazon-credentials)
- `aws_token` (string) - The AWS access token to use. This is different from the
- `aws_token` (string) - The AWS access token to use. This is different from the
access key and secret key. If you're not sure what this is, then you
probably don't need it. This will also be read from the `AWS_SESSION_TOKEN`
environmental variable.
- `changes` (array of strings) - Dockerfile instructions to add to the commit.
- `changes` (array of strings) - Dockerfile instructions to add to the commit.
Example of instructions are `CMD`, `ENTRYPOINT`, `ENV`, and `EXPOSE`. Example:
`[ "USER ubuntu", "WORKDIR /app", "EXPOSE 8080" ]`
- `ecr_login` (boolean) - Defaults to false. If true, the builder will login in
- `ecr_login` (boolean) - Defaults to false. If true, the builder will login in
order to pull the image from
[Amazon EC2 Container Registry (ECR)](https://aws.amazon.com/ecr/).
The builder only logs in for the duration of the pull. If true
@@ -175,33 +175,33 @@ You must specify (only) one of `commit`, `discard`, or `export_path`.
`login_password` will be ignored. For more information see the
[section on ECR](#amazon-ec2-container-registry).
- `login` (boolean) - Defaults to false. If true, the builder will login in
- `login` (boolean) - Defaults to false. If true, the builder will login in
order to pull the image. The builder only logs in for the duration of
the pull. It always logs out afterwards. For log into ECR see `ecr_login`.
- `login_email` (string) - The email to use to authenticate to login.
- `login_email` (string) - The email to use to authenticate to login.
- `login_username` (string) - The username to use to authenticate to login.
- `login_username` (string) - The username to use to authenticate to login.
- `login_password` (string) - The password to use to authenticate to login.
- `login_password` (string) - The password to use to authenticate to login.
- `login_server` (string) - The server address to login to.
- `login_server` (string) - The server address to login to.
- `message` (string) - Set a message for the commit.
- `message` (string) - Set a message for the commit.
- `privileged` (boolean) - If true, run the docker container with the
- `privileged` (boolean) - If true, run the docker container with the
`--privileged` flag. This defaults to false if not set.
- `pull` (boolean) - If true, the configured image will be pulled using
- `pull` (boolean) - If true, the configured image will be pulled using
`docker pull` prior to use. Otherwise, it is assumed the image already
exists and can be used. This defaults to true if not set.
- `run_command` (array of strings) - An array of arguments to pass to
- `run_command` (array of strings) - An array of arguments to pass to
`docker run` in order to run the container. By default this is set to
`["-d", "-i", "-t", "{{.Image}}", "/bin/bash"]`. As you can see, you have a
couple template variables to customize, as well.
- `volumes` (map of strings to strings) - A mapping of additional volumes to
- `volumes` (map of strings to strings) - A mapping of additional volumes to
mount into this container. The key of the object is the host path, the value
is the container path.
@@ -221,7 +221,7 @@ created image. This is accomplished using a sequence definition (a collection of
post-processors that are treated as as single pipeline, see
[Post-Processors](/docs/templates/post-processors.html) for more information):
```json
``` json
{
"post-processors": [
[
@@ -245,7 +245,7 @@ pushing the image to a container repository.
If you want to do this manually, however, perhaps from a script, you can import
the image using the process below:
```shell
``` shell
$ docker import - registry.mydomain.com/mycontainer:latest < artifact.tar
```
@@ -260,7 +260,7 @@ which tags and pushes an image. This is accomplished using a sequence definition
(a collection of post-processors that are treated as as single pipeline, see
[Post-Processors](/docs/templates/post-processors.html) for more information):
```json
``` json
{
"post-processors": [
[
@@ -285,7 +285,7 @@ Going a step further, if you wanted to tag and push an image to multiple
container repositories, this could be accomplished by defining two,
nearly-identical sequence definitions, as demonstrated by the example below:
```json
``` json
{
"post-processors": [
[
@@ -317,7 +317,7 @@ Packer can tag and push images for use in
processors work as described above and example configuration properties are
shown below:
```json
``` json
{
"post-processors": [
[
@@ -358,11 +358,11 @@ Dockerfiles have some additional features that Packer doesn't support which are
able to be worked around. Many of these features will be automated by Packer in
the future:
- Dockerfiles will snapshot the container at each step, allowing you to go
- Dockerfiles will snapshot the container at each step, allowing you to go
back to any step in the history of building. Packer doesn't do this yet, but
inter-step snapshotting is on the way.
- Dockerfiles can contain information such as exposed ports, shared volumes,
- Dockerfiles can contain information such as exposed ports, shared volumes,
and other metadata. Packer builds a raw Docker container image that has none
of this metadata. You can pass in much of this metadata at runtime with
`docker run`.
+10 -10
View File
@@ -1,11 +1,11 @@
---
description: |
The file Packer builder is not really a builder, it just creates an artifact
from a file. It can be used to debug post-processors without incurring high
wait times. It does not run any provisioners.
layout: docs
sidebar_current: docs-builders-file
page_title: File - Builders
description: |-
The file Packer builder is not really a builder, it just creates an artifact
from a file. It can be used to debug post-processors without incurring high
wait times. It does not run any provisioners.
page_title: 'File - Builders'
sidebar_current: 'docs-builders-file'
---
# File Builder
@@ -21,7 +21,7 @@ wait times. It does not run any provisioners.
Below is a fully functioning example. It doesn't do anything useful, since no
provisioners are defined, but it will connect to the specified host via ssh.
```json
``` json
{
"type": "file",
"content": "Lorem ipsum dolor sit amet",
@@ -39,7 +39,7 @@ Any [communicator](/docs/templates/communicator.html) defined is ignored.
### Required:
- `target` (string) - The path for a file which will be copied as the
- `target` (string) - The path for a file which will be copied as the
artifact.
### Optional:
@@ -47,7 +47,7 @@ Any [communicator](/docs/templates/communicator.html) defined is ignored.
You can only define one of `source` or `content`. If none of them is
defined the artifact will be empty.
- `source` (string) - The path for a file which will be copied as the
- `source` (string) - The path for a file which will be copied as the
artifact.
- `content` (string) - The content that will be put into the artifact.
- `content` (string) - The content that will be put into the artifact.
@@ -1,10 +1,10 @@
---
description: |
The googlecompute Packer builder is able to create images for use with
Google Cloud Compute Engine (GCE) based on existing images.
layout: docs
sidebar_current: docs-builders-googlecompute
page_title: Google Compute - Builders
description: |-
The googlecompute Packer builder is able to create images for use with
Google Cloud Compute Engine (GCE) based on existing images.
page_title: 'Google Compute - Builders'
sidebar_current: 'docs-builders-googlecompute'
---
# Google Compute Builder
@@ -17,6 +17,7 @@ Compute Engine](https://cloud.google.com/products/compute-engine)(GCE) based on
existing images. Building GCE images from scratch is not possible from Packer at
this time. For building images from scratch, please see
[Building GCE Images from Scratch](https://cloud.google.com/compute/docs/tutorials/building-images).
## Authentication
Authenticating with Google Cloud services requires at most one JSON file, called
@@ -38,17 +39,17 @@ scopes when launching the instance.
For `gcloud`, do this via the `--scopes` parameter:
```shell
``` shell
$ gcloud compute --project YOUR_PROJECT instances create "INSTANCE-NAME" ... \
--scopes "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/devstorage.full_control" \
```
For the [Google Developers Console](https://console.developers.google.com):
1. Choose "Show advanced options"
1. Tick "Enable Compute Engine service account"
1. Choose "Read Write" for Compute
1. Chose "Full" for "Storage"
1. Choose "Show advanced options"
2. Tick "Enable Compute Engine service account"
3. Choose "Read Write" for Compute
4. Chose "Full" for "Storage"
**The service account will be used automatically by Packer as long as there is
no *account file* specified in the Packer configuration file.**
@@ -60,50 +61,46 @@ you to create and download a credential file that will let you use the
`googlecompute` Packer builder anywhere. To make the process more
straightforwarded, it is documented here.
1. Log into the [Google Developers
1. Log into the [Google Developers
Console](https://console.developers.google.com) and select a project.
1. Under the "APIs & Auth" section, click "Credentials."
2. Under the "APIs & Auth" section, click "Credentials."
1. Click the "Create new Client ID" button, select "Service account", and click
3. Click the "Create new Client ID" button, select "Service account", and click
"Create Client ID"
1. Click "Generate new JSON key" for the Service Account you just created. A
4. Click "Generate new JSON key" for the Service Account you just created. A
JSON file will be downloaded automatically. This is your *account file*.
### Precedence of Authentication Methods
Packer looks for credentials in the following places, preferring the first location found:
1. A `account_file` option in your packer file.
1. A `account_file` option in your packer file.
1. A JSON file (Service Account) whose path is specified by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
2. A JSON file (Service Account) whose path is specified by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
1. A JSON file in a location known to the `gcloud` command-line tool. (`gcloud` creates it when it's configured)
3. A JSON file in a location known to the `gcloud` command-line tool. (`gcloud` creates it when it's configured)
On Windows, this is:
```
%APPDATA%/gcloud/application_default_credentials.json
```
%APPDATA%/gcloud/application_default_credentials.json
On other systems:
```
$HOME/.config/gcloud/application_default_credentials.json
```
$HOME/.config/gcloud/application_default_credentials.json
1. On Google Compute Engine and Google App Engine Managed VMs, it fetches credentials from the metadata server. (Needs a correct VM authentication scope configuration, see above)
4. On Google Compute Engine and Google App Engine Managed VMs, it fetches credentials from the metadata server. (Needs a correct VM authentication scope configuration, see above)
## Basic Example
Below is a fully functioning example. It doesn't do anything useful, since no
provisioners or startup-script metadata are defined, but it will effectively
repackage an existing GCE image. The account_file is obtained in the previous
repackage an existing GCE image. The account\_file is obtained in the previous
section. If it parses as JSON it is assumed to be the file itself, otherwise it
is assumed to be the path to the file containing the JSON.
```json
``` json
{
"builders": [
{
@@ -155,81 +152,81 @@ builder.
### Required:
- `project_id` (string) - The project ID that will be used to launch instances
- `project_id` (string) - The project ID that will be used to launch instances
and store images.
- `source_image` (string) - The source image to use to create the new image
- `source_image` (string) - The source image to use to create the new image
from. You can also specify `source_image_family` instead. If both
`source_image` and `source_image_family` are specified, `source_image`
takes precedence. Example: `"debian-8-jessie-v20161027"`
- `source_image_family` (string) - The source image family to use to create
- `source_image_family` (string) - The source image family to use to create
the new image from. The image family always returns its latest image that
is not deprecated. Example: `"debian-8"`.
- `zone` (string) - The zone in which to launch the instance used to create
- `zone` (string) - The zone in which to launch the instance used to create
the image. Example: `"us-central1-a"`
### Optional:
- `account_file` (string) - The JSON file containing your account credentials.
- `account_file` (string) - The JSON file containing your account credentials.
Not required if you run Packer on a GCE instance with a service account.
Instructions for creating file or using service accounts are above.
- `address` (string) - The name of a pre-allocated static external IP address.
- `address` (string) - The name of a pre-allocated static external IP address.
Note, must be the name and not the actual IP address.
- `disk_name` (string) - The name of the disk, if unset the instance name will be
- `disk_name` (string) - The name of the disk, if unset the instance name will be
used.
- `disk_size` (integer) - The size of the disk in GB. This defaults to `10`,
- `disk_size` (integer) - The size of the disk in GB. This defaults to `10`,
which is 10GB.
- `disk_type` (string) - Type of disk used to back your instance, like `pd-ssd` or `pd-standard`. Defaults to `pd-standard`.
- `disk_type` (string) - Type of disk used to back your instance, like `pd-ssd` or `pd-standard`. Defaults to `pd-standard`.
- `image_description` (string) - The description of the resulting image.
- `image_description` (string) - The description of the resulting image.
- `image_family` (string) - The name of the image family to which the
- `image_family` (string) - The name of the image family to which the
resulting image belongs. You can create disks by specifying an image family
instead of a specific image name. The image family always returns its
latest image that is not deprecated.
- `image_name` (string) - The unique name of the resulting image. Defaults to
- `image_name` (string) - The unique name of the resulting image. Defaults to
`"packer-{{timestamp}}"`.
- `instance_name` (string) - A name to give the launched instance. Beware that
- `instance_name` (string) - A name to give the launched instance. Beware that
this must be unique. Defaults to `"packer-{{uuid}}"`.
- `machine_type` (string) - The machine type. Defaults to `"n1-standard-1"`.
- `machine_type` (string) - The machine type. Defaults to `"n1-standard-1"`.
- `metadata` (object of key/value strings) - Metadata applied to the launched
- `metadata` (object of key/value strings) - Metadata applied to the launched
instance.
- `network` (string) - The Google Compute network to use for the
- `network` (string) - The Google Compute network to use for the
launched instance. Defaults to `"default"`.
- `network_project_id` (string) - The project ID for the network and subnetwork
- `network_project_id` (string) - The project ID for the network and subnetwork
to use for launched instance. Defaults to `project_id`.
- `omit_external_ip` (boolean) - If true, the instance will not have an external IP.
- `omit_external_ip` (boolean) - If true, the instance will not have an external IP.
`use_internal_ip` must be true if this property is true.
- `on_host_maintenance` (string) - Sets Host Maintenance Option. Valid
- `on_host_maintenance` (string) - Sets Host Maintenance Option. Valid
choices are `MIGRATE` and `TERMINATE`. Please see [GCE Instance Scheduling
Options](https://cloud.google.com/compute/docs/instances/setting-instance-scheduling-options),
as not all machine_types support `MIGRATE` (i.e. machines with GPUs).
as not all machine\_types support `MIGRATE` (i.e. machines with GPUs).
If preemptible is true this can only be `TERMINATE`. If preemptible
is false, it defaults to `MIGRATE`
- `preemptible` (boolean) - If true, launch a preembtible instance.
- `preemptible` (boolean) - If true, launch a preembtible instance.
- `region` (string) - The region in which to launch the instance. Defaults to
- `region` (string) - The region in which to launch the instance. Defaults to
to the region hosting the specified `zone`.
- `scopes` (array of strings) - The service account scopes for launched instance.
- `scopes` (array of strings) - The service account scopes for launched instance.
Defaults to:
```json
``` json
[
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/compute",
@@ -237,24 +234,24 @@ builder.
]
```
- `source_image_project_id` (string) - The project ID of the
- `source_image_project_id` (string) - The project ID of the
project containing the source image.
- `startup_script_file` (string) - The filepath to a startup script to run on
- `startup_script_file` (string) - The filepath to a startup script to run on
the VM from which the image will be made.
- `state_timeout` (string) - The time to wait for instance state changes.
- `state_timeout` (string) - The time to wait for instance state changes.
Defaults to `"5m"`.
- `subnetwork` (string) - The Google Compute subnetwork to use for the launched
instance. Only required if the `network` has been created with custom
subnetting.
Note, the region of the subnetwork must match the `region` or `zone` in
which the VM is launched.
- `subnetwork` (string) - The Google Compute subnetwork to use for the launched
instance. Only required if the `network` has been created with custom
subnetting.
Note, the region of the subnetwork must match the `region` or `zone` in
which the VM is launched.
- `tags` (array of strings)
- `tags` (array of strings)
- `use_internal_ip` (boolean) - If true, use the instance's internal IP
- `use_internal_ip` (boolean) - If true, use the instance's internal IP
instead of its external IP during building.
## Startup Scripts
@@ -273,10 +270,11 @@ when a startup script fails.
### Windows
A Windows startup script can only be provided via the 'windows-startup-script-cmd' instance
creation `metadata` field. The builder will _not_ wait for a Windows startup scripts to
creation `metadata` field. The builder will *not* wait for a Windows startup scripts to
terminate. You have to ensure that it finishes before the instance shuts down.
### Logging
Startup script logs can be copied to a Google Cloud Storage (GCS) location specified via the
'startup-script-log-dest' instance creation `metadata` field. The GCS location must be writeable by
the credentials provided in the builder config's `account_file`.
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -1,10 +1,10 @@
---
description: |
The Hyper-V Packer builder is able to create Hyper-V virtual machines and
export them.
layout: docs
sidebar_current: docs-builders-hyperv
page_title: Hyper-V - Builders
description: |-
The Hyper-V Packer builder is able to create Hyper-V virtual machines and
export them.
page_title: 'Hyper-V - Builders'
sidebar_current: 'docs-builders-hyperv'
---
# HyperV Builder
@@ -14,7 +14,7 @@ virtual machines and export them.
Packer currently only support building HyperV machines with an iso:
- [hyperv-iso](/docs/builders/hyperv-iso.html) - Starts from
an ISO file, creates a brand new Hyper-V VM, installs an OS,
provisions software within the OS, then exports that machine to create
an image. This is best for people who want to start from scratch.
- [hyperv-iso](/docs/builders/hyperv-iso.html) - Starts from
an ISO file, creates a brand new Hyper-V VM, installs an OS,
provisions software within the OS, then exports that machine to create
an image. This is best for people who want to start from scratch.
+4 -4
View File
@@ -1,10 +1,10 @@
---
description: |
Builders are responsible for creating machines and generating images from them
for various platforms.
layout: docs
page_title: Builders
sidebar_current: docs-builders
description: |-
Builders are responsible for creating machines and generating images from them
for various platforms.
sidebar_current: 'docs-builders'
---
# Builders
+8 -8
View File
@@ -1,12 +1,12 @@
---
description: |
The null Packer builder is not really a builder, it just sets up an SSH
connection and runs the provisioners. It can be used to debug provisioners
without incurring high wait times. It does not create any kind of image or
artifact.
layout: docs
sidebar_current: docs-builders-null
page_title: Null - Builders
description: |-
The null Packer builder is not really a builder, it just sets up an SSH
connection and runs the provisioners. It can be used to debug provisioners
without incurring high wait times. It does not create any kind of image or
artifact.
page_title: 'Null - Builders'
sidebar_current: 'docs-builders-null'
---
# Null Builder
@@ -23,7 +23,7 @@ artifact.
Below is a fully functioning example. It doesn't do anything useful, since no
provisioners are defined, but it will connect to the specified host via ssh.
```json
``` json
{
"type": "null",
"ssh_host": "127.0.0.1",
+11 -13
View File
@@ -1,9 +1,8 @@
---
description: 'The 1&1 builder is able to create images for 1&1 cloud.'
layout: docs
sidebar_current: docs-builders-oneandone
page_title: 1&1 - Builders
description: |-
The 1&1 builder is able to create images for 1&1 cloud.
page_title: '1&1 - Builders'
sidebar_current: 'docs-builders-oneandone'
---
# 1&1 Builder
@@ -24,28 +23,27 @@ builder.
### Required
- `source_image_name` (string) - 1&1 Server Appliance name of type `IMAGE`.
- `source_image_name` (string) - 1&1 Server Appliance name of type `IMAGE`.
- `token` (string) - 1&1 REST API Token. This can be specified via environment variable `ONEANDONE_TOKEN`
- `token` (string) - 1&1 REST API Token. This can be specified via environment variable `ONEANDONE_TOKEN`
### Optional
- `data_center_name` - Name of virtual data center. Possible values "ES", "US", "GB", "DE". Default value "US"
- `data_center_name` - Name of virtual data center. Possible values "ES", "US", "GB", "DE". Default value "US"
- `disk_size` (string) - Amount of disk space for this image in GB. Defaults to "50"
- `disk_size` (string) - Amount of disk space for this image in GB. Defaults to "50"
- `image_name` (string) - Resulting image. If "image_name" is not provided Packer will generate it
- `image_name` (string) - Resulting image. If "image\_name" is not provided Packer will generate it
- `retries` (int) - Number of retries Packer will make status requests while waiting for the build to complete. Default value "600".
- `url` (string) - Endpoint for the 1&1 REST API. Default URL "https://cloudpanel-api.1and1.com/v1"
- `retries` (int) - Number of retries Packer will make status requests while waiting for the build to complete. Default value "600".
- `url` (string) - Endpoint for the 1&1 REST API. Default URL "<https://cloudpanel-api.1and1.com/v1>"
## Example
Here is a basic example:
```json
``` json
{
"builders":[
{
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,11 +1,11 @@
---
description: |
This Parallels builder is able to create Parallels Desktop for Mac virtual
machines and export them in the PVM format, starting from an existing PVM
(exported virtual machine image).
layout: docs
sidebar_current: docs-builders-parallels-pvm
page_title: Parallels PVM - Builders
description: |-
This Parallels builder is able to create Parallels Desktop for Mac virtual
machines and export them in the PVM format, starting from an existing PVM
(exported virtual machine image).
page_title: 'Parallels PVM - Builders'
sidebar_current: 'docs-builders-parallels-pvm'
---
# Parallels Builder (from a PVM)
@@ -26,7 +26,7 @@ create the image. The imported machine is deleted prior to finishing the build.
Here is a basic example. This example is functional if you have an PVM matching
the settings here.
```json
``` json
{
"type": "parallels-pvm",
"parallels_tools_flavor": "lin",
@@ -54,33 +54,33 @@ builder.
### Required:
- `parallels_tools_flavor` (string) - The flavor of the Parallels Tools ISO to
- `parallels_tools_flavor` (string) - The flavor of the Parallels Tools ISO to
install into the VM. Valid values are "win", "lin", "mac", "os2"
and "other". This can be omitted only if `parallels_tools_mode`
is "disable".
- `source_path` (string) - The path to a PVM directory that acts as the source
- `source_path` (string) - The path to a PVM directory that acts as the source
of this build.
- `ssh_username` (string) - The username to use to SSH into the machine once
- `ssh_username` (string) - The username to use to SSH into the machine once
the OS is installed.
### Optional:
- `boot_command` (array of strings) - This is an array of commands to type
- `boot_command` (array of strings) - This is an array of commands to type
when the virtual machine is first booted. The goal of these commands should
be to type just enough to initialize the operating system installer. Special
keys can be typed as well, and are covered in the section below on the
boot command. If this is not specified, it is assumed the installer will
start itself.
- `boot_wait` (string) - The time to wait after booting the initial virtual
- `boot_wait` (string) - The time to wait after booting the initial virtual
machine before typing the `boot_command`. The value of this should be
a duration. Examples are "5s" and "1m30s" which will cause Packer to wait
five seconds and one minute 30 seconds, respectively. If this isn't
specified, the default is 10 seconds.
- `floppy_files` (array of strings) - A list of files to place onto a floppy
- `floppy_files` (array of strings) - A list of files to place onto a floppy
disk that is attached when the VM is booted. This is most useful for
unattended Windows installs, which look for an `Autounattend.xml` file on
removable media. By default, no floppy will be attached. All files listed in
@@ -90,20 +90,20 @@ builder.
and \[\]) are allowed. Directory names are also allowed, which will add all
the files found in the directory to the floppy.
- `floppy_dirs` (array of strings) - A list of directories to place onto
- `floppy_dirs` (array of strings) - A list of directories to place onto
the floppy disk recursively. This is similar to the `floppy_files` option
except that the directory structure is preserved. This is useful for when
your floppy disk includes drivers or if you just want to organize it's
contents as a hierarchy. Wildcard characters (\*, ?, and \[\]) are allowed.
- `output_directory` (string) - This is the path to the directory where the
- `output_directory` (string) - This is the path to the directory where the
resulting virtual machine will be created. This may be relative or absolute.
If relative, the path is relative to the working directory when `packer`
is executed. This directory must not exist or be empty prior to running
the builder. By default this is "output-BUILDNAME" where "BUILDNAME" is the
name of the build.
- `parallels_tools_guest_path` (string) - The path in the VM to upload
- `parallels_tools_guest_path` (string) - The path in the VM to upload
Parallels Tools. This only takes effect if `parallels_tools_mode`
is "upload". This is a [configuration
template](/docs/templates/engine.html) that has a single
@@ -111,14 +111,14 @@ builder.
`parallels_tools_flavor`. By default this is "prl-tools-{{.Flavor}}.iso"
which should upload into the login directory of the user.
- `parallels_tools_mode` (string) - The method by which Parallels Tools are
- `parallels_tools_mode` (string) - The method by which Parallels Tools are
made available to the guest for installation. Valid options are "upload",
"attach", or "disable". If the mode is "attach" the Parallels Tools ISO will
be attached as a CD device to the virtual machine. If the mode is "upload"
the Parallels Tools ISO will be uploaded to the path specified by
`parallels_tools_guest_path`. The default value is "upload".
- `prlctl` (array of array of strings) - Custom `prlctl` commands to execute
- `prlctl` (array of array of strings) - Custom `prlctl` commands to execute
in order to further customize the virtual machine being created. The value
of this is an array of commands to execute. The commands are executed in the
order defined in the template. For each command, the command is defined
@@ -129,35 +129,35 @@ builder.
variable is replaced with the VM name. More details on how to use `prlctl`
are below.
- `prlctl_post` (array of array of strings) - Identical to `prlctl`, except
- `prlctl_post` (array of array of strings) - Identical to `prlctl`, except
that it is run after the virtual machine is shutdown, and before the virtual
machine is exported.
- `prlctl_version_file` (string) - The path within the virtual machine to
- `prlctl_version_file` (string) - The path within the virtual machine to
upload a file that contains the `prlctl` version that was used to create
the machine. This information can be useful for provisioning. By default
this is ".prlctl\_version", which will generally upload it into the
home directory.
- `reassign_mac` (boolean) - If this is "false" the MAC address of the first
- `reassign_mac` (boolean) - If this is "false" the MAC address of the first
NIC will reused when imported else a new MAC address will be generated
by Parallels. Defaults to "false".
- `shutdown_command` (string) - The command to use to gracefully shut down the
- `shutdown_command` (string) - The command to use to gracefully shut down the
machine once all the provisioning is done. By default this is an empty
string, which tells Packer to just forcefully shut down the machine.
- `shutdown_timeout` (string) - The amount of time to wait after executing the
- `shutdown_timeout` (string) - The amount of time to wait after executing the
`shutdown_command` for the virtual machine to actually shut down. If it
doesn't shut down in this time, it is an error. By default, the timeout is
"5m", or five minutes.
- `skip_compaction` (boolean) - Virtual disk image is compacted at the end of
- `skip_compaction` (boolean) - Virtual disk image is compacted at the end of
the build process using `prl_disk_tool` utility. In certain rare cases, this
might corrupt the resulting disk image. If you find this to be the case,
you can disable compaction using this configuration value.
- `vm_name` (string) - This is the name of the virtual machine when it is
- `vm_name` (string) - This is the name of the virtual machine when it is
imported as well as the name of the PVM directory when the virtual machine
is exported. By default this is "packer-BUILDNAME", where "BUILDNAME" is the
name of the build.
@@ -186,47 +186,47 @@ simulating a human actually typing the keyboard. There are a set of special keys
available. If these are in your boot command, they will be replaced by the
proper key:
- `<bs>` - Backspace
- `<bs>` - Backspace
- `<del>` - Delete
- `<del>` - Delete
- `<enter>` and `<return>` - Simulates an actual "enter" or "return" keypress.
- `<enter>` and `<return>` - Simulates an actual "enter" or "return" keypress.
- `<esc>` - Simulates pressing the escape key.
- `<esc>` - Simulates pressing the escape key.
- `<tab>` - Simulates pressing the tab key.
- `<tab>` - Simulates pressing the tab key.
- `<f1>` - `<f12>` - Simulates pressing a function key.
- `<f1>` - `<f12>` - Simulates pressing a function key.
- `<up>` `<down>` `<left>` `<right>` - Simulates pressing an arrow key.
- `<up>` `<down>` `<left>` `<right>` - Simulates pressing an arrow key.
- `<spacebar>` - Simulates pressing the spacebar.
- `<spacebar>` - Simulates pressing the spacebar.
- `<insert>` - Simulates pressing the insert key.
- `<insert>` - Simulates pressing the insert key.
- `<home>` `<end>` - Simulates pressing the home and end keys.
- `<home>` `<end>` - Simulates pressing the home and end keys.
- `<pageUp>` `<pageDown>` - Simulates pressing the page up and page down keys.
- `<pageUp>` `<pageDown>` - Simulates pressing the page up and page down keys.
- `<leftAlt>` `<rightAlt>` - Simulates pressing the alt key.
- `<leftAlt>` `<rightAlt>` - Simulates pressing the alt key.
- `<leftCtrl>` `<rightCtrl>` - Simulates pressing the ctrl key.
- `<leftCtrl>` `<rightCtrl>` - Simulates pressing the ctrl key.
- `<leftShift>` `<rightShift>` - Simulates pressing the shift key.
- `<leftShift>` `<rightShift>` - Simulates pressing the shift key.
- `<leftAltOn>` `<rightAltOn>` - Simulates pressing and holding the alt key.
- `<leftAltOn>` `<rightAltOn>` - Simulates pressing and holding the alt key.
- `<leftCtrlOn>` `<rightCtrlOn>` - Simulates pressing and holding the ctrl key.
- `<leftCtrlOn>` `<rightCtrlOn>` - Simulates pressing and holding the ctrl key.
- `<leftShiftOn>` `<rightShiftOn>` - Simulates pressing and holding the shift key.
- `<leftShiftOn>` `<rightShiftOn>` - Simulates pressing and holding the shift key.
- `<leftAltOff>` `<rightAltOff>` - Simulates releasing a held alt key.
- `<leftAltOff>` `<rightAltOff>` - Simulates releasing a held alt key.
- `<leftCtrlOff>` `<rightCtrlOff>` - Simulates releasing a held ctrl key.
- `<leftCtrlOff>` `<rightCtrlOff>` - Simulates releasing a held ctrl key.
- `<leftShiftOff>` `<rightShiftOff>` - Simulates releasing a held shift key.
- `<leftShiftOff>` `<rightShiftOff>` - Simulates releasing a held shift key.
- `<wait>` `<wait5>` `<wait10>` - Adds a 1, 5 or 10 second pause before
- `<wait>` `<wait5>` `<wait10>` - Adds a 1, 5 or 10 second pause before
sending any additional keys. This is useful if you have to generally wait
for the UI to update before typing more.
@@ -246,7 +246,7 @@ Extra `prlctl` commands are defined in the template in the `prlctl` section. An
example is shown below that sets the memory and number of CPUs within the
virtual machine:
```json
``` json
{
"prlctl": [
["set", "{{.Name}}", "--memsize", "1024"],
+14 -14
View File
@@ -1,10 +1,10 @@
---
description: |
The Parallels Packer builder is able to create Parallels Desktop for Mac
virtual machines and export them in the PVM format.
layout: docs
sidebar_current: docs-builders-parallels
page_title: Parallels - Builders
description: |-
The Parallels Packer builder is able to create Parallels Desktop for Mac
virtual machines and export them in the PVM format.
page_title: 'Parallels - Builders'
sidebar_current: 'docs-builders-parallels'
---
# Parallels Builder
@@ -17,16 +17,16 @@ Packer actually comes with multiple builders able to create Parallels machines,
depending on the strategy you want to use to build the image. Packer supports
the following Parallels builders:
- [parallels-iso](/docs/builders/parallels-iso.html) - Starts from an ISO file,
creates a brand new Parallels VM, installs an OS, provisions software within
the OS, then exports that machine to create an image. This is best for people
who want to start from scratch.
- [parallels-iso](/docs/builders/parallels-iso.html) - Starts from an ISO file,
creates a brand new Parallels VM, installs an OS, provisions software within
the OS, then exports that machine to create an image. This is best for people
who want to start from scratch.
- [parallels-pvm](/docs/builders/parallels-pvm.html) - This builder imports an
existing PVM file, runs provisioners on top of that VM, and exports that
machine to create an image. This is best if you have an existing Parallels VM
export you want to use as the source. As an additional benefit, you can feed
the artifact of this builder back into itself to iterate on a machine.
- [parallels-pvm](/docs/builders/parallels-pvm.html) - This builder imports an
existing PVM file, runs provisioners on top of that VM, and exports that
machine to create an image. This is best if you have an existing Parallels VM
export you want to use as the source. As an additional benefit, you can feed
the artifact of this builder back into itself to iterate on a machine.
## Requirements
@@ -1,9 +1,8 @@
---
description: 'The ProfitBricks builder is able to create images for ProfitBricks cloud.'
layout: docs
sidebar_current: docs-builders-profitbricks
page_title: ProfitBricks - Builders
description: |-
The ProfitBricks builder is able to create images for ProfitBricks cloud.
page_title: 'ProfitBricks - Builders'
sidebar_current: 'docs-builders-profitbricks'
---
# ProfitBricks Builder
@@ -24,39 +23,37 @@ builder.
### Required
- `image` (string) - ProfitBricks volume image. Only Linux public images are supported. To obtain full list of available images you can use [ProfitBricks CLI](https://github.com/profitbricks/profitbricks-cli#image).
- `image` (string) - ProfitBricks volume image. Only Linux public images are supported. To obtain full list of available images you can use [ProfitBricks CLI](https://github.com/profitbricks/profitbricks-cli#image).
- `password` (string) - ProfitBricks password. This can be specified via environment variable `PROFITBRICKS_PASSWORD', if provided. The value definded in the config has precedence over environemnt variable.
- `username` (string) - ProfitBricks username. This can be specified via environment variable `PROFITBRICKS_USERNAME', if provided. The value definded in the config has precedence over environemnt variable.
- `password` (string) - ProfitBricks password. This can be specified via environment variable \`PROFITBRICKS\_PASSWORD', if provided. The value definded in the config has precedence over environemnt variable.
- `username` (string) - ProfitBricks username. This can be specified via environment variable \`PROFITBRICKS\_USERNAME', if provided. The value definded in the config has precedence over environemnt variable.
### Optional
- `cores` (integer) - Amount of CPU cores to use for this build. Defaults to "4".
- `cores` (integer) - Amount of CPU cores to use for this build. Defaults to "4".
- `disk_size` (string) - Amount of disk space for this image in GB. Defaults to "50"
- `disk_size` (string) - Amount of disk space for this image in GB. Defaults to "50"
- `disk_type` (string) - Type of disk to use for this image. Defaults to "HDD".
- `disk_type` (string) - Type of disk to use for this image. Defaults to "HDD".
- `location` (string) - Defaults to "us/las".
- `location` (string) - Defaults to "us/las".
- `ram` (integer) - Amount of RAM to use for this image. Defalts to "2048".
- `ram` (integer) - Amount of RAM to use for this image. Defalts to "2048".
- `retries` (string) - Number of retries Packer will make status requests while waiting for the build to complete. Default value 120 seconds.
- `retries` (string) - Number of retries Packer will make status requests while waiting for the build to complete. Default value 120 seconds.
- `snapshot_name` (string) - If snapshot name is not provided Packer will generate it
- `snapshot_name` (string) - If snapshot name is not provided Packer will generate it
- `snapshot_password` (string) - Password for the snapshot.
- `url` (string) - Endpoint for the ProfitBricks REST API. Default URL "https://api.profitbricks.com/rest/v2"
- `snapshot_password` (string) - Password for the snapshot.
- `url` (string) - Endpoint for the ProfitBricks REST API. Default URL "<https://api.profitbricks.com/rest/v2>"
## Example
Here is a basic example:
```json
``` json
{
"builders": [
{
File diff suppressed because it is too large Load Diff
+27 -27
View File
@@ -1,12 +1,12 @@
---
description: |
The triton Packer builder is able to create new images for use with Triton.
These images can be used with both the Joyent public cloud (which is powered
by Triton) as well with private Triton installations. This builder uses the
Triton Cloud API to create images.
layout: docs
sidebar_current: docs-builders-triton
page_title: Triton - Builders
description: |-
The triton Packer builder is able to create new images for use with Triton.
These images can be used with both the Joyent public cloud (which is powered
by Triton) as well with private Triton installations. This builder uses the
Triton Cloud API to create images.
page_title: 'Triton - Builders'
sidebar_current: 'docs-builders-triton'
---
# Triton Builder
@@ -30,7 +30,7 @@ This reusable image can then be used to launch new machines.
The builder does *not* manage images. Once it creates an image, it is up to you
to use it or delete it.
~> **Private installations of Triton must have custom images enabled!** To use
~&gt; **Private installations of Triton must have custom images enabled!** To use
the Triton builder with a private/on-prem installation of Joyent's Triton
software, you'll need an operator to manually
[enable custom images](https://docs.joyent.com/private-cloud/install/image-management)
@@ -48,14 +48,14 @@ builder.
### Required:
- `triton_account` (string) - The username of the Triton account to use when
- `triton_account` (string) - The username of the Triton account to use when
using the Triton Cloud API.
- `triton_key_id` (string) - The fingerprint of the public key of the SSH key
- `triton_key_id` (string) - The fingerprint of the public key of the SSH key
pair to use for authentication with the Triton Cloud API. If
`triton_key_material` is not set, it is assumed that the SSH agent has the
private key corresponding to this key ID loaded.
- `source_machine_image` (string) - The UUID of the image to base the new
- `source_machine_image` (string) - The UUID of the image to base the new
image on. Triton supports multiple types of images, called 'brands' in
Triton / Joyent lingo, for contains and VM's. See the chapter [Containers
and virtual machines](https://docs.joyent.com/public-cloud/instances) in the
@@ -66,40 +66,40 @@ builder.
`70e3ae72-96b6-11e6-9056-9737fd4d0764` for version 16.3.1 of the 64bit
SmartOS base image (a 'joyent' brand image).
- `source_machine_package` (string) - The Triton package to use while building
- `source_machine_package` (string) - The Triton package to use while building
the image. Does not affect (and does not have to be the same) as the package
which will be used for a VM instance running this image. On the Joyent
public cloud this could for example be `g3-standard-0.5-smartos`.
- `image_name` (string) - The name the finished image in Triton will be
- `image_name` (string) - The name the finished image in Triton will be
assigned. Maximum 512 characters but should in practice be much shorter
(think between 5 and 20 characters). For example `postgresql-95-server` for
an image used as a PostgreSQL 9.5 server.
- `image_version` (string) - The version string for this image. Maximum 128
- `image_version` (string) - The version string for this image. Maximum 128
characters. Any string will do but a format of `Major.Minor.Patch` is
strongly advised by Joyent. See [Semantic Versioning](http://semver.org/)
for more information on the `Major.Minor.Patch` versioning format.
### Optional:
- `triton_url` (string) - The URL of the Triton cloud API to use. If omitted
- `triton_url` (string) - The URL of the Triton cloud API to use. If omitted
it will default to the `us-sw-1` region of the Joyent Public cloud. If
you are using your own private Triton installation you will have to supply
the URL of the cloud API of your own Triton installation.
- `triton_key_material` (string) - Path to the file in which the private key
- `triton_key_material` (string) - Path to the file in which the private key
of `triton_key_id` is stored. For example `/home/soandso/.ssh/id_rsa`. If
this is not specified, the SSH agent is used to sign requests with the
`triton_key_id` specified.
- `source_machine_firewall_enabled` (boolean) - Whether or not the firewall of
- `source_machine_firewall_enabled` (boolean) - Whether or not the firewall of
the VM used to create an image of is enabled. The Triton firewall only
filters inbound traffic to the VM. All outbound traffic is always allowed.
Currently this builder does not provide an interface to add specific
firewall rules. Unless you have a global rule defined in Triton which allows
SSH traffic enabling the firewall will interfere with the SSH provisioner.
The default is `false`.
- `source_machine_metadata` (object of key/value strings) - Triton metadata
- `source_machine_metadata` (object of key/value strings) - Triton metadata
applied to the VM used to create the image. Metadata can be used to pass
configuration information to the VM without the need for networking. See
[Using the metadata
@@ -107,38 +107,38 @@ builder.
Joyent documentation for more information. This can for example be used to
set the `user-script` metadata key to have Triton start a user supplied
script after the VM has booted.
- `source_machine_name` (string) - Name of the VM used for building the image.
- `source_machine_name` (string) - Name of the VM used for building the image.
Does not affect (and does not have to be the same) as the name for a VM
instance running this image. Maximum 512 characters but should in practice
be much shorter (think between 5 and 20 characters). For example
`mysql-64-server-image-builder`. When omitted defaults to
`packer-builder-[image_name]`.
- `source_machine_networks` (array of strings) - The UUID's of Triton networks
- `source_machine_networks` (array of strings) - The UUID's of Triton networks
added to the source machine used for creating the image. For example if any
of the provisioners which are run need Internet access you will need to add
the UUID's of the appropriate networks here. If this is not specified,
instances will be placed into the default Triton public and internal
networks.
- `source_machine_tags` (object of key/value strings) - Tags applied to the VM
- `source_machine_tags` (object of key/value strings) - Tags applied to the VM
used to create the image.
- `image_acls` (array of strings) - The UUID's of the users which will have
- `image_acls` (array of strings) - The UUID's of the users which will have
access to this image. When omitted only the owner (the Triton user whose
credentials are used) will have access to the image.
- `image_description` (string) - Description of the image. Maximum 512
- `image_description` (string) - Description of the image. Maximum 512
characters.
- `image_eula_url` (string) - URL of the End User License Agreement (EULA) for
- `image_eula_url` (string) - URL of the End User License Agreement (EULA) for
the image. Maximum 128 characters.
- `image_homepage` (string) - URL of the homepage where users can find
- `image_homepage` (string) - URL of the homepage where users can find
information about the image. Maximum 128 characters.
- `image_tags` (object of key/value strings) - Tag applied to the image.
- `image_tags` (object of key/value strings) - Tag applied to the image.
## Basic Example
Below is a minimal example to create an joyent-brand image on the Joyent public
cloud:
```json
``` json
{
"builders": [
{
File diff suppressed because it is too large Load Diff

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