packer-cn/website/source/docs/command-line/validate.html.markdown

34 lines
1.0 KiB
Markdown
Raw Normal View History

2013-06-20 17:13:35 -04:00
---
2015-07-22 22:31:00 -04:00
description: |
The `packer validate` Packer command is used to validate the syntax and
configuration of a template. The command will return a zero exit status on
success, and a non-zero exit status on failure. Additionally, if a template
doesn't validate, any error messages will be outputted.
layout: docs
page_title: 'Validate - Command-Line'
...
2013-06-20 17:13:35 -04:00
# Command-Line: Validate
2015-07-22 22:31:00 -04:00
The `packer validate` Packer command is used to validate the syntax and
configuration of a [template](/docs/templates/introduction.html). The command
will return a zero exit status on success, and a non-zero exit status on
failure. Additionally, if a template doesn't validate, any error messages will
be outputted.
2013-06-20 17:13:35 -04:00
Example usage:
2015-07-22 22:31:00 -04:00
``` {.text}
2013-06-20 17:13:35 -04:00
$ packer validate my-template.json
Template validation failed. Errors are shown below.
Errors validating build 'vmware'. 1 error(s) occurred:
* Either a path or inline script must be specified.
```
## Options
2015-07-22 23:25:58 -04:00
- `-syntax-only` - Only the syntax of the template is checked. The
configuration is not validated.