# Unable to pass parameter to scripts while packaging in Packer

**URL:** <https://discuss.hashicorp.com/t/unable-to-pass-parameter-to-scripts-while-packaging-in-packer/52325>\
**Category:** Packer\
**Created:** [April 5, 2023, 5:16am UTC](https://discuss.hashicorp.com/t/unable-to-pass-parameter-to-scripts-while-packaging-in-packer/52325 "2023-04-05T05:16:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveen.samudrala](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@praveen.samudrala](https://discuss.hashicorp.com/u/praveen.samudrala)\
**Post date:** [April 5, 2023, 5:16am UTC](https://discuss.hashicorp.com/t/unable-to-pass-parameter-to-scripts-while-packaging-in-packer/52325/1 "2023-04-05T05:16:34Z")

</div>

Dear Team,

“provisioners”: [  
{  
“type”: “shell”,  
“execute\_command”: “echo ‘’ | sudo -S -u root {{ .Vars }} bash ‘{{ .Path }}’”,  
“script”: “./packer/scripts/install.sh --cl\_name hostname”,  
“environment\_vars”: [  
“DB\_HOME={{ user `DB_home` }}”,"  
]  
},  
]

* * *

Is there any way that we can pass parameter to scripts like above. Without passing parameters, above script runs successfull.

---

<div class="post-metadata">

**Author:** ![macmiranda](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/macmiranda/32/34065_2.png) [@macmiranda](https://discuss.hashicorp.com/u/macmiranda)\
**Post date:** [April 5, 2023, 6:33am UTC](https://discuss.hashicorp.com/t/unable-to-pass-parameter-to-scripts-while-packaging-in-packer/52325/2 "2023-04-05T06:33:35Z")

</div>

Im not a Packer user but looking at the [documentation](https://developer.hashicorp.com/packer/docs/provisioners/shell#script) there doesn’t seem to be a way to do that.

Now considering that you want your builds to be reproducible, that argument should always be the same for the same template which makes it redundant, doesn’t it?

If you need to change the argument, instead change the script and create a new template.
