1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Merge branch 'master' into loc_record_support

This commit is contained in:
Mark Tearle
2021-02-15 22:52:49 +08:00
committed by GitHub
4 changed files with 41 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
name: OctoDNS name: OctoDNS
on: [pull_request] on:
pull_request:
paths-ignore:
- '**.md'
jobs: jobs:
ci: ci:

View File

@@ -28,6 +28,7 @@ It is similar to [Netflix/denominator](https://github.com/Netflix/denominator).
- [Dynamic sources](#dynamic-sources) - [Dynamic sources](#dynamic-sources)
- [Contributing](#contributing) - [Contributing](#contributing)
- [Getting help](#getting-help) - [Getting help](#getting-help)
- [Related Projects & Resources](#related-projects--resources)
- [License](#license) - [License](#license)
- [Authors](#authors) - [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. 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 ## Other Uses
### Syncing between providers ### 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). 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)
- **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)
- 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!
## License ## License
OctoDNS is licensed under the [MIT license](LICENSE). OctoDNS is licensed under the [MIT license](LICENSE).

View File

@@ -91,7 +91,10 @@ class BaseProvider(BaseSource):
self.log.info('apply: disabled') self.log.info('apply: disabled')
return 0 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) self._apply(plan)
return len(plan.changes) return len(plan.changes)

View File

@@ -6,6 +6,7 @@ from __future__ import absolute_import, division, print_function, \
unicode_literals unicode_literals
from requests import HTTPError, Session from requests import HTTPError, Session
from operator import itemgetter
import logging import logging
from ..record import Create, Record from ..record import Create, Record
@@ -429,6 +430,12 @@ class PowerDnsBaseProvider(BaseProvider):
for change in changes: for change in changes:
class_name = change.__class__.__name__ class_name = change.__class__.__name__
mods.append(getattr(self, '_mod_{}'.format(class_name))(change)) 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.sort(key=itemgetter('changetype'))
self.log.debug('_apply: sending change request') self.log.debug('_apply: sending change request')
try: try: