Allow comments through a "Description" key

30 views
Skip to first unread message

Justin Nearing

unread,
Jan 4, 2018, 1:50:11 PM1/4/18
to Packer
As we know, JSON does not allow comments, and only root level comments are valid in a template.

If there was a Description key, that doesn't do much beyond validating correctly, it would be a fantastic place to comment each step of the template. This becomes especially useful if you have a lot of provisioning steps, or have steps for workarounds, or steps of non-obvious intent.

Example from the tutorial

{
  "variables": ["..."],
  "builders": ["..."],

  "provisioners": [{
"description": "Install latest Redis version; WARNING: This may conflict with foo",
 "type": "shell", "inline": [ "sleep 30", "sudo apt-get update", "sudo apt-get install -y redis-server" ] }] }

Kevin Milner

unread,
Jan 16, 2018, 12:07:59 PM1/16/18
to Packer
I second this.

Rajendra Kumar

unread,
Jul 8, 2019, 1:35:07 AM7/8/19
to Packer
I second this, Even I am looking for adding description to each step for provisioners and generate a story of what actually is getting installed and what is happening during the bake.
Reply all
Reply to author
Forward
0 new messages