Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert pkrvars.json to pkrvars.hcl #12599

Open
markfaine opened this issue Aug 18, 2023 · 0 comments
Open

Convert pkrvars.json to pkrvars.hcl #12599

markfaine opened this issue Aug 18, 2023 · 0 comments

Comments

@markfaine
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

Description

Convert foo.pkrvars.json to foo.pkrvars.hcl with packer hcl2_upgrade command. Or just generally it could also be described as supporting conversion from json to hcl for any of the various json file types that packer can read now. That would probably be better.

Use Case(s)

I'm generating my pkrvars variable files from ansible and it's relatively easy to output json with the to_json filter for ansible. However, there is no such thing as a to_hcl filter. If I could then run packer hcl2_upgrade foo.pkrvars.json and it would generate foo.pkrvars.hcl that would help a lot. It's not really just this use case but probably dozens of sources will output json but nothing really supports hcl except packer and terraform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants