hashicorp / hashicorp/packer-plugin-azure
azure-chroot: .Device and .MountPath variables not available for provisioners
- Dominant language
- Go
- Stars
- 63
- Forks
- 103
- PR merge metrics
- No merged PRs in 30d
Description
_This issue was originally opened by @arvindn05 as hashicorp/packer#10990. It was migrated here as a result of the [Packer plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). The original body of the issue is below._
#### Overview of the Issue
In azure-chroot: .Device and .MountPath variables not available for provisioners. This seems to have been fixed for amazon-chroot as part of https://github.com/hashicorp/packer/issues/6746
### Packer version
1.7.2
### Simplified Packer Buildfile
``` provisioner "shell" {
environment_vars = [ "DISK={{ .Device }}" ]
execute_command = "chmod +x {{ .Path }} ; sudo {{ .Vars }} {{ .Path }}"
remote_folder = "/tmp"
...
```
### Operating system and Environment details
Centos
### Log Fragments and crash.log files
2021/05/04 04:49:06 packer-builder-azure-chroot plugin: Executing: /bin/sh []string{"/bin/sh", "-c", "chroot /mnt/packer-azure-chroot-disks/sdc /bin/sh -c \"chmod +x /tmp/script_9775.sh ; sudo DISK='no value' PACKER_BUILDER_TYPE='azure-chroot' PACKER_BUILD_NAME='image' /tmp/script_9775.sh\""}
Contributor guide
Research direction
Start by reproducing the simplified azure-chroot build with the shell provisioner and compare its variable handling with the amazon-chroot fix referenced in issue 6746. The change is done when .Device and .MountPath are available to provisioners instead of resolving to no value in the generated command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, go
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100