Skip to content
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

The auto-approval in TF is preventing builds from completing. #7

Open
yoshinori-hardy opened this issue Mar 6, 2018 · 3 comments
Open

Comments

@yoshinori-hardy
Copy link

Jenkins - 2.89.4
Terraform Plugin - 1.0.9
Terraform => 0.11.0
centos - 7

Version 0.11.0 of terraform introduced an auto-approval flag and this is preventing my build from completing.

see the jenkins log output:

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value:

Apply cancelled.

FATAL: java.lang.Exception: Terraform Apply failed: 1
	at org.jenkinsci.plugins.terraform.TerraformBuildWrapper.executeApply(TerraformBuildWrapper.java:249)
	at org.jenkinsci.plugins.terraform.TerraformBuildWrapper.setUp(TerraformBuildWrapper.java:269)
	at hudson.model.Build$BuildExecution.doRun(Build.java:157)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1724)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)

Finished: FAILURE

rolling back to version 0.10.8 resolved my issue.

@yoshinori-hardy
Copy link
Author

from the Hashicorp docs an auto approve flag can be added to handle this

"terraform apply -input=false -auto-approve"

https://www.terraform.io/guides/running-terraform-in-automation.html#terraform-apply-input-false-auto-approve

@ritwik-singh-yash
Copy link

I have the same issue.
As we cannot run any terraform command in this , how can this be resolved?

@dpires
Copy link
Owner

dpires commented Mar 20, 2019

I'm looking for a solution that will be backwards compatible with < 0.10.0 as with the addition of -auto-approve, also came the deprecation of -force on destroy (replaced with -auto-approve).

Once I figure out a checkbox solution for both, i'll make a release.

dpires added a commit that referenced this issue Feb 25, 2020
Add Terraform installation to PATH and add @symbol annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants