10

I would like to generate a public/private ssh key pair during packer provisioning and copy the files to the host machine. Is there a way to copy files out from the VM to the host using packer?

Tom Sweeney
  • 640
  • 1
  • 9
  • 19

1 Answers1

14

I figured it out. The file provisioner has a "direction" option that allows download instead of upload

{
"type": "file",
"source": "app.tar.gz",
"destination": "/tmp/app.tar.gz",
"direction" : "download"
}
Tim Potter
  • 2,437
  • 21
  • 31
Tom Sweeney
  • 640
  • 1
  • 9
  • 19