github.com/aclaygray/packer@v1.3.2/website/source/docs/commands/validate.html.md (about) 1 --- 2 description: | 3 The `packer validate` Packer command is used to validate the syntax and 4 configuration of a template. The command will return a zero exit status on 5 success, and a non-zero exit status on failure. Additionally, if a template 6 doesn't validate, any error messages will be outputted. 7 layout: docs 8 page_title: 'packer validate - Commands' 9 sidebar_current: 'docs-commands-validate' 10 --- 11 12 # `validate` Command 13 14 The `packer validate` Packer command is used to validate the syntax and 15 configuration of a [template](/docs/templates/index.html). The command 16 will return a zero exit status on success, and a non-zero exit status on 17 failure. Additionally, if a template doesn't validate, any error messages will 18 be outputted. 19 20 Example usage: 21 22 ``` text 23 $ packer validate my-template.json 24 Template validation failed. Errors are shown below. 25 26 Errors validating build 'vmware'. 1 error(s) occurred: 27 28 * Either a path or inline script must be specified. 29 ``` 30 31 ## Options 32 33 - `-syntax-only` - Only the syntax of the template is checked. The configuration 34 is not validated. 35 36 - `-except=foo,bar,baz` - Builds all the builds except those with the given 37 comma-separated names. Build names by default are the names of their builders, 38 unless a specific `name` attribute is specified within the configuration. 39 40 - `-only=foo,bar,baz` - Only build the builds with the given comma-separated 41 names. Build names by default are the names of their builders, unless a 42 specific `name` attribute is specified within the configuration. 43 44 - `-var` - Set a variable in your packer template. This option can be used 45 multiple times. This is useful for setting version numbers for your build. 46 47 - `-var-file` - Set template variables from a file.