github.com/hashicorp/packer@v1.14.3/website/content/docs/commands/fix.mdx (about)

     1  ---
     2  description: |
     3    The `packer fix` command updates backward incompatible templates for the running version of Packer. 
     4  page_title: packer fix command reference
     5  ---
     6  
     7  # `packer fix` command reference
     8  
     9  
    10  The `packer fix` command takes a template and finds backward incompatible
    11  parts of it and brings it up to date so it can be used with the latest version
    12  of Packer. After you update to a new Packer release, you should run the fix
    13  command to make sure your templates work with the new release.
    14  
    15  -> **JSON template-only command**: You cannot use the `packer fix` command to update HCL2 templates.
    16  
    17  The fix command will output the changed template to standard out, so you should
    18  redirect standard out using standard OS-specific techniques if you want to save it
    19  to a file. For example, on Linux systems, you may want to do this:
    20  
    21  ```shell-session
    22  $ packer fix old.json > new.json
    23  ```
    24  
    25  If fixing fails for any reason, the fix command will exit with a non-zero exit
    26  status. Error messages appear on standard error, so if you're redirecting
    27  output, you'll still see error messages.
    28  
    29  -> **Even when Packer fix doesn't do anything** to the template, the
    30  template will be outputted to standard out. Things such as configuration key
    31  ordering and indentation may be changed. The output format however, is
    32  pretty-printed for human readability.
    33  
    34  The full list of fixes that the fix command performs is visible in the help
    35  output, which can be seen via `packer fix -h`.
    36  
    37  ## Options
    38  
    39  - `-validate=false` - Disables validation of the fixed template. True by
    40    default.