New ssh connection per provisioning script?

20 views
Skip to first unread message

Sameer Agrawal

unread,
Jan 11, 2021, 12:31:42 PM1/11/21
to Packer
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

Megan Marsh

unread,
Jan 11, 2021, 12:35:39 PM1/11/21
to packe...@googlegroups.com
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.

--
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 packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/8e694d29-d06b-45d7-890b-39ca398e9fb3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages