semaphoreui / semaphore

Modern UI and powerful API for Ansible, Terraform, OpenTofu, PowerShell and other DevOps tools.
https://semaphoreui.com
MIT License
10.69k stars 1.07k forks source link

Problem: Terraform actions always require manual confirm #2518

Open GJurriens opened 2 weeks ago

GJurriens commented 2 weeks ago

Issue

I have setup a Terraform task in SemaphoreUI, and whenever I run that task I manually need to confirm the run. Even if I check the box at "-auto-approve", it still comes up with the question and it will wait till it has an answer. I would really like to be able to run the Terrafrom task on demand initiated by a webhook, so the code gets run every time I submit the code.

Impact

Other

Installation method

Docker

Database

BoltDB

Browser

No response

Semaphore Version

v2.10.35-a71a3c5-1730103926

Ansible Version

Ansible is not involved, it is Terraform.
Terraform itself is the version delivered with SemaphoreUI docker container. I also make use of the Cloudflare provider, that is at version 4.45.0

Logs & errors

No response

Manual installation - system information

I tried without reverse proxy and with Treafik (v3), same result on both.

Configuration

No response

Additional information

No response

fr6nco commented 2 weeks ago

Facing the same issue on the exact same version.

I tried to run a terraform plan with additional -destroy CLI arg, but it got ignored too.

GJurriens commented 1 day ago

Any chance someone could create a fix for this? I guess it shouldn't be that hard, but unfortunately I don't have any skills in this programming language, so I have no idea on where to start. I have a feeling some input is just not passed on when pressing the run button.

fr6nco commented 1 day ago

hey, dont have it set up right now, I was just testing it, and due to these limitations we decided not to use semaphore UI.

If I remember correctly, there's a possibility somewhere in the UI to add env variables.

Try setting the following

TF_CLI_ARGS_apply="-auto-approve"

I believe those args worked this way