-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed getting the "github.com/hashicorp/azure" plugin #13028
Comments
Hi @ivia-hitachids, The This could be an Azure Devops problem too, so I would suggest maybe discussing that with them (cc @JenGoldstrich). |
As @lbajolet-hashicorp I agree that this error appears to be related to the Azure Devops not allowing users access to write to the temp directory for the machine or container running the pipeline. Is there a directory where you can install files into? I myself am not too familiar with the agent setup for Azure Devops but if you can write files to a directory on the agent you can override the default plugin path by the - task: Bash@3
displayName: 'Build Base Ubuntu Image'
inputs:
targetType: inline
script: |
export PACKER_PLUGIN_PATH=/path/to/writable/dir
packer init -upgrade templates/ubuntu-2204/template-base.pkr.hcl
packer build \
-parallel-builds=1 \
-var "vm-type=base" \
-var "image-version=$(GitVersion.MajorMinorPatch)" \
-var "exclude-from-latest=$(isNotMain_Lower)" \
-var "client-id=$(GetToken.clientId)" \
-var "client-secret=$(GetToken.clientSecret)" \
-var "tenant-id=$(GetToken.tenantId)" \
$(System.DefaultWorkingDirectory)/templates/ubuntu-2204/template-base.pkr.hcl |
As per CIS hardening guidelines /tmp should be mounted without the
executable bit set, (noexec) I am running into the same issue with the
latest packer on a RHEL9 VMware system.
…On Mon 10 Jun 2024, 19:45 Wilken Rivera, ***@***.***> wrote:
As @lbajolet-hashicorp <https://github.com/lbajolet-hashicorp> I agree
that this error appears to be related to the Azure Devops not allowing
users access to write to the temp directory for the machine or container
running the pipeline.
Is there a directory where you can install files into?
I myself am not too familiar with the agent setup for Azure Devops but if
you can write files to a directory on the agent you can override the
default plugin path by the PACKER_PLUGIN_PATH environment variable in
your task.
- task: ***@***.***
displayName: 'Build Base Ubuntu Image'
inputs:
targetType: inline
script: | export PACKER_PLUGIN_PATH=/path/to/writable/dir packer init -upgrade templates/ubuntu-2204/template-base.pkr.hcl packer build \ -parallel-builds=1 \ -var "vm-type=base" \ -var "image-version=$(GitVersion.MajorMinorPatch)" \ -var "exclude-from-latest=$(isNotMain_Lower)" \ -var "client-id=$(GetToken.clientId)" \ -var "client-secret=$(GetToken.clientSecret)" \ -var "tenant-id=$(GetToken.tenantId)" \ $(System.DefaultWorkingDirectory)/templates/ubuntu-2204/template-base.pkr.hcl
—
Reply to this email directly, view it on GitHub
<#13028 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOJ2TRUTFGJOZHSLNQSVYDZGXX4NAVCNFSM6AAAAABI7TIBJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJZGA3DANRZGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi @jayfitzpatrick, I wonder, do the CIS guidelines imply the host should not have Now, On the guest OS that'd mean you cannot use |
CIS guidlines state that /tmp should be a mount with mount option noexec added. This allows for files to be created and read from /tmp but not executed. It's also the same for /var/tmp. https://www.tenable.com/audits/items/CIS_Red_Hat_EL7_STIG_v2.0.0_L1_Server.audit:cb3137da1a61c8c0f01d86957ea67ada |
I understand the rationale here, and I misunderstood the case in my previous message, Now to respond, plugins when they're installed are staged into We could maybe have an option for Packer to use another directory as its staging area for installing plugins, but this is not something we delivered with 1.11.0. I'll test that out locally, but I would suggest if this is the problem to try that. We can probably add something to our docs so users who encounter this problem have a way out. |
Update: I can confirm that setting
The same without |
Not if the host is a CIS hardened system that is doing the build. |
Yep that's fair. In this case, setting |
I tried to run the Azure DevOps pipeline with this task here:
However, it is showing this error:
|
Hi @nywilken I tried to run with your suggestion, however, continues showing the errors.
|
Could you clarify what If it defaults to You also don't need to run the commands with |
I changed my tasks as below and it works fine. Regarding definition about
|
@ivia-hitachids thanks for following up on this and reporting your findings. I believe others will run into this issue. I opened a PR to document the reliance of TMPDIR for plugin installation. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Overview of the Issue
I am running a new pipeline in Azure DevOps and it is showing this error:
Reproduction Steps
Azure cli version
Packer version
Packer version
From
Packer v1.11.0
Simplified Packer Template
Azure DevOps pipeline task
Operating system and Environment details
Ubuntu 22.04
The text was updated successfully, but these errors were encountered: