From 4081c7b31b1ea31855b94c1572cc18e5a46410b7 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Fri, 5 Feb 2021 11:55:37 -0800 Subject: [PATCH 1/8] Add the number of changes and zone name to "making changes" --- octodns/provider/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/octodns/provider/base.py b/octodns/provider/base.py index ae87844..eb097a2 100644 --- a/octodns/provider/base.py +++ b/octodns/provider/base.py @@ -91,7 +91,10 @@ class BaseProvider(BaseSource): self.log.info('apply: disabled') return 0 - self.log.info('apply: making changes') + zone_name = plan.desired.name + num_changes = len(plan.changes) + self.log.info('apply: making %d changes to %s', num_changes, + zone_name) self._apply(plan) return len(plan.changes) From 2346ebc1ce72edca8d066218cafb29e46d1f7ee9 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Mon, 8 Feb 2021 21:24:41 -0500 Subject: [PATCH 2/8] Added list of projects & resources. --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index a65e28f..84dc033 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ It is similar to [Netflix/denominator](https://github.com/Netflix/denominator). - [Dynamic sources](#dynamic-sources) - [Contributing](#contributing) - [Getting help](#getting-help) +- [Related Projects & Resources](#related-projects--resources) - [License](#license) - [Authors](#authors) @@ -225,6 +226,8 @@ Most of the things included in OctoDNS are providers, the obvious difference bei The `class` key in the providers config section can be used to point to arbitrary classes in the python path so internal or 3rd party providers can easily be included with no coordination beyond getting them into PYTHONPATH, most likely installed into the virtualenv with OctoDNS. +For examples of building third-party sources and providers, see [Related Projects & Resources](#related-projects--resources). + ## Other Uses ### Syncing between providers @@ -286,6 +289,29 @@ Please see our [contributing document](/CONTRIBUTING.md) if you would like to pa If you have a problem or suggestion, please [open an issue](https://github.com/octodns/octodns/issues/new) in this repository, and we will do our best to help. Please note that this project adheres to the [Contributor Covenant Code of Conduct](/CODE_OF_CONDUCT.md). +## Related Projects & Resources + +- **GitHub Action:** [OctoDNS-Sync](https://github.com/marketplace/actions/octodns-sync) +- **Sample Implementations.** See how others are using it + - [`hackclub/dns`](https://github.com/hackclub/dns) + - [`kubernetes/k8s.io:/dns`](https://github.com/kubernetes/k8s.io/tree/master/dns) + - [`g0v-network/domains`](https://github.com/g0v-network/domains) + - [`jekyll/dns`](https://github.com/jekyll/dns) + - [`parkr/dns`](https://github.com/parkr/dns) +- **Custom Sources & Providers.** + - [`octodns/octodns-ddns`](https://github.com/octodns/octodns-ddns): A simple Dynamic DNS source. + - [`doddo/octodns-lexicon`](https://github.com/doddo/octodns-lexicon): Use [Lexicon](https://github.com/AnalogJ/lexicon) providers as octoDNS providers. + - [`asyncon/octoblox`](https://github.com/asyncon/octoblox): [Infoblox](https://www.infoblox.com/) provider. + - [`sukiyaki/octodns-netbox`](https://github.com/sukiyaki/octodns-netbox): [NetBox](https://github.com/netbox-community/netbox) source. + - [`kompetenzbolzen/octodns-custom-provider`](https://github.com/kompetenzbolzen/octodns-custom-provider): zonefile provider & phpIPAM source. +- **Resources.** + - Article: [Visualising DNS records with Neo4j](https://medium.com/@costask/querying-and-visualising-octodns-records-with-neo4j-f4f72ab2d474) + code + - Video: [FOSDEM 2019 - DNS as code with octodns](https://archive.fosdem.org/2019/schedule/event/dns_octodns/) + - GitHub Blog: [Enabling DNS split authority with OctoDNS](https://github.blog/2017-04-27-enabling-split-authority-dns-with-octodns/) + - Tutorial: [How To Deploy and Manage Your DNS using OctoDNS on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-deploy-and-manage-your-dns-using-octodns-on-ubuntu-18-04) + +If you know of any other resources, please do let us know! + ## License OctoDNS is licensed under the [MIT license](LICENSE). From e991d8dc10d7693e8d4242f14e604fcd6d9df1c5 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 9 Feb 2021 16:02:52 -0500 Subject: [PATCH 3/8] Removed implementation example. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 84dc033..9f608a0 100644 --- a/README.md +++ b/README.md @@ -297,7 +297,6 @@ If you have a problem or suggestion, please [open an issue](https://github.com/o - [`kubernetes/k8s.io:/dns`](https://github.com/kubernetes/k8s.io/tree/master/dns) - [`g0v-network/domains`](https://github.com/g0v-network/domains) - [`jekyll/dns`](https://github.com/jekyll/dns) - - [`parkr/dns`](https://github.com/parkr/dns) - **Custom Sources & Providers.** - [`octodns/octodns-ddns`](https://github.com/octodns/octodns-ddns): A simple Dynamic DNS source. - [`doddo/octodns-lexicon`](https://github.com/doddo/octodns-lexicon): Use [Lexicon](https://github.com/AnalogJ/lexicon) providers as octoDNS providers. From a8366aa02db6fac3d090f0d9a12edf3f7916ab4a Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 9 Feb 2021 16:06:25 -0500 Subject: [PATCH 4/8] Stopped running CI for doc changes. --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0f62f96..337ebb0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,8 @@ name: OctoDNS -on: [pull_request] +on: + pull_request: + paths-ignore: + - '**.md' jobs: ci: From 39d86f023e411c0af869a14ce7f12eda41f4d649 Mon Sep 17 00:00:00 2001 From: Steven Honson Date: Fri, 12 Feb 2021 00:29:48 +1100 Subject: [PATCH 5/8] powerdns: deletes before replaces --- octodns/provider/powerdns.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/octodns/provider/powerdns.py b/octodns/provider/powerdns.py index de7743c..a7f150b 100644 --- a/octodns/provider/powerdns.py +++ b/octodns/provider/powerdns.py @@ -7,6 +7,7 @@ from __future__ import absolute_import, division, print_function, \ from requests import HTTPError, Session import logging +from operator import itemgetter from ..record import Create, Record from .base import BaseProvider @@ -381,6 +382,12 @@ class PowerDnsBaseProvider(BaseProvider): for change in changes: class_name = change.__class__.__name__ mods.append(getattr(self, '_mod_{}'.format(class_name))(change)) + + # Ensure that any DELETE modifications always occur before any REPLACE + # modifications. This ensures that an A record can be replaced by a + # CNAME record and vice-versa. + mods = sorted(mods, key=itemgetter('changetype')) + self.log.debug('_apply: sending change request') try: From fdf74f9dd36365674473d8ee8d110da92f99b2c8 Mon Sep 17 00:00:00 2001 From: Steven Honson Date: Fri, 12 Feb 2021 00:48:42 +1100 Subject: [PATCH 6/8] powerdns: sort in place --- octodns/provider/powerdns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns/provider/powerdns.py b/octodns/provider/powerdns.py index a7f150b..ec30559 100644 --- a/octodns/provider/powerdns.py +++ b/octodns/provider/powerdns.py @@ -386,7 +386,7 @@ class PowerDnsBaseProvider(BaseProvider): # Ensure that any DELETE modifications always occur before any REPLACE # modifications. This ensures that an A record can be replaced by a # CNAME record and vice-versa. - mods = sorted(mods, key=itemgetter('changetype')) + mods.sort(key=itemgetter('changetype')) self.log.debug('_apply: sending change request') From 6034e8022f24a83ca80d1c32e1fc0420ecaca606 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Thu, 11 Feb 2021 17:05:42 -0800 Subject: [PATCH 7/8] Swap import order --- octodns/provider/powerdns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns/provider/powerdns.py b/octodns/provider/powerdns.py index ec30559..8ffff46 100644 --- a/octodns/provider/powerdns.py +++ b/octodns/provider/powerdns.py @@ -6,8 +6,8 @@ from __future__ import absolute_import, division, print_function, \ unicode_literals from requests import HTTPError, Session -import logging from operator import itemgetter +import logging from ..record import Create, Record from .base import BaseProvider From 29c8f3253ed3d17cc8490bfc6e4b8e6f108b1411 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 11 Feb 2021 20:35:32 -0500 Subject: [PATCH 8/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9f608a0..c784c0a 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,7 @@ If you have a problem or suggestion, please [open an issue](https://github.com/o - Video: [FOSDEM 2019 - DNS as code with octodns](https://archive.fosdem.org/2019/schedule/event/dns_octodns/) - GitHub Blog: [Enabling DNS split authority with OctoDNS](https://github.blog/2017-04-27-enabling-split-authority-dns-with-octodns/) - Tutorial: [How To Deploy and Manage Your DNS using OctoDNS on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-deploy-and-manage-your-dns-using-octodns-on-ubuntu-18-04) + - Cloudflare Blog: [Improving the Resiliency of Our Infrastructure DNS Zone](https://blog.cloudflare.com/improving-the-resiliency-of-our-infrastructure-dns-zone/) If you know of any other resources, please do let us know!