Open nirvana-msu opened 1 year ago
Also happens with Packer 1.8.5. Source OS Arch Linux, target OS Ubuntu 22.04. I used the Hetzner Cloud builder. My reproduction example:
build {
sources = ["source.hcloud.aufziehvogel"]
provisioner "shell" {
inline = ["cloud-init status --wait"]
}
provisioner "shell" {
inline = [
"mkdir /tmp/debug",
"touch /tmp/debug/file1",
"touch /tmp/debug/file2",
]
}
provisioner "file" {
direction = "download"
source = "/tmp/debug/"
destination = "outdir"
}
}
This sounds like a bug for sure. Thanks for reporting.
Community Note
Overview of the Issue
File provisioner appears to embed source directory within destination when source directotory is specified with a trailing slash, and direction is download, contrary to the docs.
The issue appears to only be present when
direction = "download"
. When uploading, it works as documented.Reproduction Steps
results in downloading files under
./dest/source/
, instead of under./dest/
as specified in documentation.Result is the same whether or not destination includes a trailing slash.
Packer version
Packer v1.8.3
(slightly out of date, but I couldn't find any related bug report so haven't tried updating).Operating system and Environment details
Both source and destination systems run Ubuntu 22.04.