hello

I think you are trying to go to a complex workaround and you could make
things simple.

create a file with all the variables you need

then using file provisioning copy the file to the VM/Docker
then using shell provisioning run an script that use that file



On Wed, Mar 7, 2018 at 12:29 PM, Bubunia Patra <bubunia2000s...@gmail.com>
wrote:

> Hi,
>
> Is there a way I can pass the inline params to the provisioner scripts for
> example instead of var1 /varlist[0]/[1]  or that needs to be  passed script
> and script need to do parsing??
>
> Regards
> Pradeep
>
> execute_command": "{{.Vars}} var1={{user `arg1`}} var2={{user `arg2`}} sudo
> -E -S bash '{{.Path}' "
>
> On Tuesday, March 6, 2018 at 11:02:49 PM UTC+8, Bubunia Patra wrote:
>>
>>
>> Hi,
>>
>> The below method you suggested works perfect for me :
>>
>> "execute_command": "{{.Vars}} var1={{user `arg1`}} var2={{user `arg2`}} sudo
>> -E -S bash '{{.Path}' "
>>
>> But when the var1=test-packer-prov or var1=test.packer.prov then it fails
>> with the "command not found" error.
>>  Where as if var1=test_packer_prov it works perfectly.
>>
>> What I tried to add the escape \ with - the JSON parsing fails.
>>
>> I am trying to use inline/file provision upload method(
>> https://groups.google.com/forum/#!topic/packer-tool/G2TKbBQOGcQ)
>>
>> Regards
>> Pradeep
>>
>>
>>
>>
>> On Tuesday, March 6, 2018 at 4:14:52 PM UTC+8, Alvaro Miranda Aguilera
>> wrote:
>>>
>>> hello
>>>
>>> if you can share what and how are you doing (and theres time explaining
>>> why?) then will be easier to help you
>>>
>>> so far you are to the point you can have variables in packer and then
>>> use them in the guest vm
>>>
>>> if you are having issues, perhaps you can use a file
>>>
>>> packer can provision a file and then on the script you can source the
>>> file to have all the variables.
>>>
>>> special characters are hard since it may be interpreted somewhere.
>>>
>>> if I had to do this, probably will use shell local to put put the
>>> variables in a file, or have them in a file already and then use them in
>>> the VM.
>>>
>>> Alvaro
>>>
>>> --
> 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 packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/fb6e09f8-e4e7-43e8-b6af-8588e3b737ea%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/fb6e09f8-e4e7-43e8-b6af-8588e3b737ea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Alvaro

-- 
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 packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAHqq0eza-%2BZ3Un9Zxy7ngGC_Qv67Bk4KghbLiPEWtUeiDDpAwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to