Closed kaiyuanlim closed 2 weeks ago
Thanks for reporting. The provider does run packer init here: https://github.com/toowoxx/terraform-provider-packer/blob/main/provider/resource_packer_image.go#L219
I'll have to take a closer look at this.
Okay, that is strange.
This might help.
resource "packer_image" "azdo" {
directory = "${path.module}/packer"
variables = {
rg_name = data.azurerm_resource_group.azdo.name
rg_region = data.azurerm_resource_group.azdo.location
vm_size = local.vm_size
gallery_name = azurerm_shared_image.azdo_ubuntu_22_04.gallery_name
image_name = azurerm_shared_image.azdo_ubuntu_22_04.name
image_version = var.image_version
disk_size = local.disk_size
azdo_username = local.azdo_username
vnet_name = local.name
}
triggers = {
folder_hash = sha1(join("", [for f in fileset("packer", "*") : filesha1("${path.module}/packer/${f}")]))
}
}
#And inside my "packer" folder
ls
agent.pkr.hcl config github.com packer.pkr.hcl scripts variables.pkr.hcl
´´´
Any updates?
Not sure what the issue is, I will have to investigate further. One thing I noticed Is that you can use this data source for your folder trigger: https://registry.terraform.io/providers/toowoxx/packer/latest/docs/data-sources/files
Not sure what the issue is, I will have to investigate further. One thing I noticed Is that you can use this data source for your folder trigger: https://registry.terraform.io/providers/toowoxx/packer/latest/docs/data-sources/files
Yes but i am already using "directory" in "packer_image" and i added a trigger.
The issue is that it does not seems to download and install the required plugins when i ran terraform apply.
I'm unable to reproduce this at the HEAD of the branch. When the new version is released, please test again and let me know.
And when will that be? Thank you in advanced.
And when will that be?
I'll try to get it out today.
I'm going to close this issue because I can't reproduce it on the latest version. If the issue persists please let me know.
Describe the bug I got an error when running terraform apply.
To Reproduce Steps to reproduce the behavior:
Using packer.pkr.hcl with content
Expected behavior Terraform packer should run packer init before packer build
Additional information (please complete the following information):
Additional context