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

Unable to use password authentification in Linux environment #334

Closed
1 task done
ilgiznurgaliev opened this issue Jul 26, 2023 · 3 comments
Closed
1 task done

Unable to use password authentification in Linux environment #334

ilgiznurgaliev opened this issue Jul 26, 2023 · 3 comments
Labels

Comments

@ilgiznurgaliev
Copy link

ilgiznurgaliev commented Jul 26, 2023

Terraform CLI and Provider Versions

Terraform v1.5.3
on linux_amd64

  • provider registry.terraform.io/hashicorp/dns v3.3.2

Terraform Configuration

terraform {
  required_providers {
    dns = {
      source = "hashicorp/dns"
    }
  }
}

variable "zone" {
  description = "DNS zone"
  type        = string
}

variable "compute_instances" {
  description = "Compute instances"
  type = map(object({
    ip_address         = string
    create_dns_records = optional(bool)
  }))
  default = {}
}

resource "dns_a_record_set" "this" {
  for_each = { for instance_name, instance in var.compute_instances :
  instance_name => instance if instance.create_dns_records }
  zone      = var.zone
  name      = each.key
  addresses = [each.value.ip_address]
}

Expected Behavior

DNS records will be created as per configs

Actual Behavior

terraform plan shows that new dns records will be created, so as expected
terraform apply works as expected in Windows 10, but fails in Linux environments (Ubuntu 22.04):

│ Error: Error updating DNS record: error negotiating GSS context: 2 errors occurred:
│       * KRB5_CONFIG: not found
│       * stat /etc/krb5.conf: no such file or directory

It's not really clear why it tries to open /etc/krb5.conf while DNS_UPDATE_PASSWORD is set and DNS_UPDATE_KEYTAB is unset?

Steps to Reproduce

  1. Export env variables:
export DNS_UPDATE_SERVER="dns-server.example.net"
export DNS_UPDATE_REALM="EXAMPLE.NET"
export DNS_UPDATE_USERNAME="username"
export DNS_UPDATE_PASSWORD="XXXXXXXXXXXXXXXX"
  1. terraform plan -out plan
  2. terraform apply plan

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Joris29
Copy link

Joris29 commented Mar 27, 2024

@ilgiznurgaliev How did you fix this?

@ilgiznurgaliev
Copy link
Author

@ilgiznurgaliev How did you fix this?

Created /etc/krb5.conf manually with content like below:

[libdefaults]
default_realm = EXAMPLE.COM

[realms]
EXAMPLE.COM = {
  kdc = kdc01.example.com
  kdc = kdc02.example.com
}

[domain_realm]
.example.com = EXAMPLE.COM
example.com = EXAMPLE.COM

After that it works with no any issues.

Copy link

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants