Using variables in json parameter for chef-solo provisoner

16 views
Skip to first unread message

Dougal Ballantyne

unread,
Jul 24, 2016, 7:01:05 PM7/24/16
to Packer
I am trying to work out the correct way to use variables as part of the json parameter for the chef-solo provisioner. I have the user variable called bar_enabled and I want to set it to true.

For example, I can pass this:

      "type" : "chef-solo",
      "json" : {
        "foo" : {
          "bar" : {
            "enabled" : "{{user `bar_enabled`}}"
          }
        }
      }

However I need to pass an unquoted true as the parameter, such as:

      "type" : "chef-solo",
      "json" : {
        "foo" : {
          "bar" : {
            "enabled" : {{user `nvidia_enabled`}}
          }
        }
      },
Reply all
Reply to author
Forward
0 new messages