taiidani / terraform-provider-jenkins

Jenkins Terraform Provider
https://registry.terraform.io/providers/taiidani/jenkins/latest
Apache License 2.0
76 stars 42 forks source link

Problem with authentication - Don't get any error #73

Closed srpedromiranda closed 2 years ago

srpedromiranda commented 2 years ago

I'm currently trying to use the provider to do some experiments on deploying jobs and credentials to a jenkins server. But i'm not being able to dispite getting no error on the apply.

I'm using the following configuration:

provider "jenkins" { server_url = "https://jenkins.tools..." username = "empty" password = "empty" }

terraform { required_providers { jenkins = { source = "taiidani/jenkins" version = ">= 0.5.0" } } }

resource "jenkins_job" "pmiranda_terraform_job" { name = "pmiranda_terraform_job" template = file("template.html") }

The only thing that is not exactly as I'm using on the "apply" is the server_url. If I change that I actually get an error. Besides that, if I use any username/password I always get:

/Documents/_Lakehouse/iac_data_product_branch $ terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:

  • create

Terraform will perform the following actions:

jenkins_job.pmiranda_terraform_job will be created

  • resource "jenkins_job" "pmiranda_terraform_job" {
    • id = (known after apply)
    • name = "pmiranda_terraform_job"
    • template = <<-EOT (...) EOT }

Plan: 1 to add, 0 to change, 0 to destroy.

Can anyone help figure out what am I missing? Thank you all and happy new year.

github-actions[bot] commented 2 years ago

Stale issue message

taiidani commented 2 years ago

@srpedromiranda Is authentication enabled on your target Jenkins instance? For example, with the default authentication Jenkins will allow anyone in -- regardless of the username/password they provide. You need to set up an auth layer before it will begin rejecting invalid credentials.

Example using the Jenkins internal user database:

image
│ Error: Connection Failed, Please verify that the host and credentials are correct.
│
│   with provider["registry.terraform.io/taiidani/jenkins"],
│   on providers.tf line 3, in provider "jenkins":
│    3: provider "jenkins" {