How to copy a file to host during packer provisioning?

萝らか妹 提交于 2019-12-08 17:19: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?


回答1:


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"
}


来源:https://stackoverflow.com/questions/36511571/how-to-copy-a-file-to-host-during-packer-provisioning

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!