Unfortunately this isn't currently possible. The idea's been on our radar for a while but it'd involve some architectural changes that are complex, and probably won't happen until our json-style templating is complete deprecated and removed from Packer.
On Mon, Jan 11, 2021 at 9:31 AM Sameer Agrawal <[email protected]> wrote: > Hi, > > Is there a way where packer can instantiate a new ssh connection for every > provisioning script/section? > > For example, If I have something like this below, can we have a terminate > the existing connection and start a new one for the next section? > "provisioners": [ > { > "type": "shell-local", > "command": "tar cf toupload/files.tar files" > }, > { > "destination": "/tmp/", > "source": "./toupload", > "type": "file" > }, > { > "inline": [ > "cd /tmp && tar xf toupload/files.tar", > "rm toupload/files.tar" > ], > "type": "shell" > } > ] > } > > Thanks > Sameer > > -- > 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/hashicorp/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/8e694d29-d06b-45d7-890b-39ca398e9fb3n%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/8e694d29-d06b-45d7-890b-39ca398e9fb3n%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/hashicorp/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/CAGPV1uq8tRuZF6c%3DR-AEaebk5rAJEmr7D%3DxYGi6Vri--s-oNRw%40mail.gmail.com.
