Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
a2f437fd
Commit
a2f437fd
authored
Jun 08, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
website: templates introduction
parent
3e7ee60a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
4 deletions
+74
-4
website/source/docs/templates/introduction.html.markdown
website/source/docs/templates/introduction.html.markdown
+63
-0
website/source/layouts/docs.erb
website/source/layouts/docs.erb
+11
-4
No files found.
website/source/docs/templates/introduction.html.markdown
0 → 100644
View file @
a2f437fd
---
layout
:
"
docs"
---
# Templates
Templates are JSON files that configure the various components of Packer
in order to create one or more machine images. Templates are portable, static,
and readable and writable by both humans and computers. This has the added
benefit of being able to not only create and modify templates by hand, but
also write scripts to dynamically create or modify templates.
Templates are given to commands such as
`packer build`
, which will
take the template and actually run the builds within it, producing
any resulting machine images.
## Template Structure
A template is a JSON object that has a set of keys configuring various
components of Packer. The available keys within a template are listed below.
Along with each key, it is noted whether it is required or not.
*
`builders`
(_required_) is an array of one or more objects that defines
the builders that will be used to create machine images for this template,
and configures each of those builders. For more information on how to define
and configure a builder, read the sub-section on
[
configuring builders in templates
](
/docs/templates/builders.html
)
.
*
`provisioners`
(optional) is an array of one or more objects that defines
the provisioners that will be used to install and configure software for
the machines created by each of the builders. This is an optional field.
If it is not specified, then no provisioners will be run. For more
information on how to define and configure a provisioner, read the
sub-section on
[
configuring provisioners in templates
](
/docs/templates/provisioners.html
)
.
## Example Template
Below is an example of a basic template that is nearly fully functional. It is just
missing valid AWS access keys. Otherwise, it would work properly with
`packer build`
.
<pre
class=
"prettyprint"
>
{
"builders": [
{
"type": "amazon-ebs",
"access_key": "...",
"secret_key": "...",
"region": "us-east-1",
"source_ami": "ami-de0d9eb7",
"ssh_username": "ubuntu",
"ami_name": "packer {{.CreateTime}}"
}
],
"provisioners": [
{
"type": "shell",
"path": "setup_things.sh"
}
]
}
</pre>
website/source/layouts/docs.erb
View file @
a2f437fd
...
...
@@ -15,6 +15,8 @@
padding-bottom
:
40px
;
}
</style>
<script
src=
"https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"
></script>
</head>
<body>
...
...
@@ -26,11 +28,16 @@
<ul
class=
"nav nav-list"
>
<li><a
href=
"/docs/what-is-packer.html"
>
What is Packer?
</a></li>
<li><a
href=
"/docs/installation.html"
>
Installation
</a></li>
<li
class=
"nav-header"
>
Basics
</li>
<li><a
href=
"/docs/basics/terminology.html"
>
Terminology
</a></li>
<li><a
href=
"#"
>
Command-Line
</a></li>
<li><a
href=
"#"
>
Templates
</a></li>
<li
class=
"nav-header"
>
Command-Line
</li>
<li><a
href=
"#"
>
Introduction
</a></li>
<li><a
href=
"#"
>
Build
</a></li>
<li
class=
"nav-header"
>
Templates
</li>
<li><a
href=
"/docs/templates/introduction.html"
>
Introduction
</a></li>
<li><a
href=
"#"
>
Builders
</a></li>
<li><a
href=
"#"
>
Provisioners
</a></li>
<li
class=
"nav-header"
>
Builders
</li>
<li><a
href=
"#"
>
EC2 (AMI)
</a></li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment