【发布时间】:2023-03-27 06:41:01
【问题描述】:
当尝试在 Azure Pipeline 中将 terraform init 作为任务运行时,会出现错误提示
spawn C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe ENOENT
安装看起来不错,因为在安装步骤中验证了基本功能 (terraform version)
相关管道任务
...
- task: TerraformInstaller@0
displayName: 'Install Terraform 0.12.7'
inputs:
terraformVersion: 0.12.7
- task: TerraformTaskV1@0
displayName: 'Terraform : init'
inputs:
command: 'init'
workingDirectory: '$(System.DefaultWorkingDirectory)/Terraform/terraform'
...
安装 Terraform 0.12.7
...
Verifying Terraform installation...
C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe version
Terraform v0.12.7
Your version of Terraform is out of date! The latest version
is 0.12.19. You can update by downloading from www.terraform.io/downloads.html
Finishing: Install Terraform 0.12.7
地形:初始化
...
C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe validate
##[error]Error: There was an error when attempting to execute the process 'C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe'. This may indicate the process failed to start. Error: spawn C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe ENOENT
Finishing: Terraform : validate
许多其他用户报告通过添加结帐步骤成功解决了此问题,但管道会自动执行此操作(可能以前的版本没有),并且手动添加它没有效果(实际上由于选项不同需要多 2 秒)。
【问题讨论】:
标签: terraform azure-pipelines terraform-provider-azure