I don't think you can, the best way to use scripts on its own file and you 
can do if statements. 

"scripts": [
    "scripts/setup.sh",
    "scripts/update.sh",
    "scripts/packages.sh"
],


On Monday, August 5, 2019 at 10:01:29 AM UTC-7, Vritual Packer wrote:

> Spent quite a while googling this and can't find an example...
>
> What is the proper way to do a if then statement inside of an inline  
> shell?
>
> example:
> "type": "shell",
> "inline" : [
> "yum update -y"
>  " if [ $VAR -eq "something" ]; then
>    do this
>    and this
>    and finally this
>   else
>   do something else
> fi",
>
> Thank you for any help...
>
>
>

-- 
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/66ccce05-98ed-49a1-9cdd-24fc13a876e2%40googlegroups.com.

Reply via email to