See https://github.com/hashicorp/packer/issues/2630
On Sun, Oct 6, 2019, 00:57 Yusuke Masuda <[email protected]> wrote: > Hi. > > I want to specify a variable for 'bool' type item such as > "keep_input_artifact". > > Firstly, I tried this. > "keep_input_artifact": "{{user `keep_input_artifact`}}", > : > : > "variables": { > "keep_input_artifact": true, > } > > Then I got an error below. > Failed to parse template: 2 errors occurred: > * variable keep_input_artifact: '' expected type 'string', got > unconvertible type 'bool' > * post-processor 1.1: 1 error(s) decoding: > * 'keep_input_artifact' expected type 'bool', got unconvertible type > 'string' > > It seems to say that it is wrong to specify the string value to 'bool' > type. > > Next I tried removing the quotes. > "keep_input_artifact": {{user `keep_input_artifact`}}, > : > : > "variables": { > "keep_input_artifact": true, > } > > So I got another error below. > Failed to parse template: Error parsing JSON: invalid character '{' > looking for beginning of object key string > At line 42, column 34 (offset 1204): > 41: "type": "vagrant", > 42: "keep_input_artifact": {{ > ^ > > The error was a kind of JSON syntax error, seemed that it interpret the > bracket for template as a part of JSON object. > > I wonder I cannot use a variable for not string fields. > Please give me any advice for this, if you have. > > Sincerly, > > Yusuke > > -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/81b07ab2-bea2-4ccb-b9c4-4f81641a4bb0%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/81b07ab2-bea2-4ccb-b9c4-4f81641a4bb0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt8GR7_1b70od%3D1AFejPLRXSh2FN_W37SGhtkuzB3PUs4g%40mail.gmail.com.
