Skip to content

packer subcommands (console,inspect,validate) should support HCL format #8538

Closed
@nqb

Description

@nqb

Feature Description

Starting from Packer 1.5.0, we could use HCL templates in place of JSON templates but it looks like packer validate doesn't yet support HCL format.

Use Case(s)

test.pkr.hcl

source "docker" "example" {
       image = "centos:7"
       commit = "true"
}

build {
    sources = [
        "source.docker.example"
    ]

    provisioner "ansible" {
        playbook_file = "site.yml"
    }
        
}
$ packer validate test.pkr.hcl 
Failed to parse template: Error parsing JSON: invalid character 's' looking for beginning of value
At line 1, column 1 (offset 1):
    1: s
      ^

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions