See https://www.packer.io/docs/templates/user-variables.html#using-home-variable
On Thu, Sep 6, 2018, 06:04 <[email protected]> wrote: > I have a provisioners section that has a following snippet > { > "type":"file", > "source":"my-init.sh", > "destination":"/root/myuser/run/my-init.sh" > }, > > > The source value may not always be in same directory where I am running > the packer build from. For example my packer.json might be at > "/home/user1/packer.json" and I have the "my-init.sh" at > "/home/user1/somedir". I want to replace the source with something like a > bash variable which is the $HOME on linux like > { > "type":"file", > "source":"$HOME/my-init.sh", > "destination":"/root/myuser/run/my-init.sh" > }, > > > > > How do I do that? > > -- > 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/b1ee0fa5-73d4-4f64-af8f-f4d7662522cf%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/b1ee0fa5-73d4-4f64-af8f-f4d7662522cf%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CALz9Rt_ZQq3%3DrDyukNAWA4V9fSOG-bOC367Za0iOwrcx9tVWmg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
