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

Initial SOA records conflicting with INCEPTION-INCREMENT #43

Open
c33s opened this issue Dec 1, 2019 · 2 comments
Open

Initial SOA records conflicting with INCEPTION-INCREMENT #43

c33s opened this issue Dec 1, 2019 · 2 comments

Comments

@c33s
Copy link
Contributor

c33s commented Dec 1, 2019

to create a SOA record for a domain i have to use powerdns_record like this:

resource "powerdns_record" "SOA_example_com" {
  zone    = "example.com."
  name    = "example.com."
  type    = "SOA"
  ttl     = 3600
  records = ["dns1.example2.com. hostmaster.example.com. 2019120101 10800 3600 3600000 3600"]
}

which creates a record with this entry. if i have set my soa_edit_api to empty according #29 it works like charm but of course it is much better to have set the serial automatically. so if i set soa_api_edit to INCEPTION-INCREMENT i get a conflict because the serial got increased automatically and isn't equal to the serial set in the terraform config before:

  • running terraform apply creates the soa record (with the config above)
  • the serial gets increased automatically
  • running terraform apply again results in this:
      id:                 "example.com.:::SOA" => <computed> (forces new resource)
      name:               "example.com." => "example.com."
      records.#:          "1" => "1"
      records.xxxxxxxxx9: "ns1.example2.com. hostmaster.example.com. 2019120102 10800 3600 3600000 3000" => "" (forces new re
      records.xxxxxxxxx2: "" => "ns1.example2.com. hostmaster.example.com. 2019120101 10800 3600 3600000 3000" (forces new re
      ttl:                "3600" => "3600"
      type:               "SOA" => "SOA"
      zone:               "example.com." => "example.com."

so how to use this provider to create an initial SOA record but increase the serial without this conflict?

@c33s
Copy link
Contributor Author

c33s commented Dec 2, 2019

maybe this would be an own ticket or its a reopen of #29 or its ok to put it here:

  • having setup a soa record for example domain with terraform
  • terraform apply runs with no errors or actions
  • add a new record to an non-existing domain (made a typo) where soa-edit-api is set to INCEPTION-INCREMENT
  • running terraform apply results in Failed to create PowerDNS Record: Error creating record set: example_com.:::MX, reason: "Could not find domain 'example_com.'" which is correct because of the typo
  • fixing the typo -> example_com -> example.com
  • terraform apply results in the error fo Updating serial in SOA record results in error #29 (see below)
-/+ powerdns_record.SOA_example_com (new resource required)
id:                 "example.com.:::SOA" => <computed> (forces new resource)
name:               "example.com." => "example.com."
records.#:          "1" => "1"
records.2145257032: "dns1.example2.com. hostmaster.example.com. 2019120202 10800 3600 3600000 3000" => "" (forces new resource)
records.2374626224: "" => "dns1.example2.com. hostmaster.example.com. 2019120102 10800 3600 3600000 3000" (forces new resource)
ttl:                "3600" => "3600"
type:               "SOA" => "SOA"
zone:               "example.com." => "example.com."
* powerdns_record.SOA_example_com (destroy): 1 error(s) occurred:

* powerdns_record.SOA_example_com: Error deleting PowerDNS Record: Error deleting record: example.com. SOA, reason: "No SOA found for domain 'example.com.'"
* powerdns_record.MX_example_com: 1 error(s) occurred:

* powerdns_record.MX_example_com: Failed to create PowerDNS Record: Error creating record set: example.com.:::MX, reason: "No SOA found for domain 'example.com.'"

i have to connect to powerdns and change the soa-edit for the domain to '' and rerun terraform apply

shouldn't the soa record be set via powerdns_zone and such conflicts handled in the provider?

@ion1
Copy link

ion1 commented Jul 17, 2020

Would it make sense to support a special SOA serial such as 0 one could use in combination with soa-edit-api which will override the serial anyway? The provider would just need to ignore changes to it if the resource uses the special value.

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

2 participants