2013-07-04 15:07:53 -04:00
|
|
|
---
|
|
|
|
layout: "docs"
|
2013-09-01 13:02:46 -04:00
|
|
|
page_title: "File Provisioner"
|
2013-07-04 15:07:53 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
# File Provisioner
|
|
|
|
|
|
|
|
Type: `file`
|
|
|
|
|
2013-07-04 15:58:11 -04:00
|
|
|
The file provisioner uploads files to machines built by Packer. The
|
|
|
|
recommended usage of the file provisioner is to use it to upload files,
|
|
|
|
and then use [shell provisioner](/docs/provisioners/shell.html) to move
|
|
|
|
them to the proper place, set permissions, etc.
|
2013-07-04 15:07:53 -04:00
|
|
|
|
|
|
|
## Basic Example
|
|
|
|
|
|
|
|
<pre class="prettyprint">
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"source": "app.tar.gz",
|
|
|
|
"destination": "/tmp/app.tar.gz"
|
|
|
|
}
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
## Configuration Reference
|
|
|
|
|
|
|
|
The available configuration options are listed below. All elements are required.
|
|
|
|
|
|
|
|
* `source` (string) - The path to a local file to upload to the machine. The
|
2013-07-04 15:58:11 -04:00
|
|
|
path can be absolute or relative. If it is relative, it is relative to the
|
|
|
|
working directory when Packer is executed.
|
2013-07-04 15:07:53 -04:00
|
|
|
|
2013-07-04 15:58:11 -04:00
|
|
|
* `destination` (string) - The path where the file will be uploaded to in the
|
|
|
|
machine. This value must be a writable location and any parent directories
|
2013-07-04 15:07:53 -04:00
|
|
|
must already exist.
|