website: add usage notice to init

The `packer init' command's wording was not clear, so it was changed in
a preceding commit, and this commit aims to add more details on how the
command is meant to be used, along with a simple example.
pull/12584/head
Lucas Bajolet 3 years ago committed by Lucas Bajolet
parent 0e8544258d
commit 539313bd4e

@ -19,6 +19,26 @@ the first command that should be executed when working with a new or existing
template. This command is always safe to run multiple times. Though subsequent
runs may give errors, this command will never delete anything.
You should invoke `packer init` on either an HCL2 template, or a directory that contains
at least a valid HCL2 template, and eventually other related dependencies like varfiles
for example.
Example:
```sh
$ ls .
template.pkr.hcl varfile.pkrvars.pkr.hcl
$ packer init template.pkr.hcl # You can invoke packer init on a single template in this case
# This works if the template is self-contained, but may fail if
# the template is meant to be built as a bundle of partials.
$ packer init . # Alternatively, you can invoke packer init on a directory instead,
# which behaves the same in a configuration like this one, but if
# the target is a collection ofHCL2 templates, this is the
# preferred way to invoke it.
```
Packer does not currently have the notion of a state like Terraform has. In other words,
currently `packer init` is only in charge of installing Packer plugins.

Loading…
Cancel
Save