mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Add some docs around lenient and its uses
This commit is contained in:
@@ -6,15 +6,17 @@ OctoDNS supports the following record types:
|
||||
|
||||
* `A`
|
||||
* `AAAA`
|
||||
* `ALIAS`
|
||||
* `CAA`
|
||||
* `CNAME`
|
||||
* `DNAME`
|
||||
* `MX`
|
||||
* `NAPTR`
|
||||
* `NS`
|
||||
* `PTR`
|
||||
* `SSHFP`
|
||||
* `SPF`
|
||||
* `SRV`
|
||||
* `SSHFP`
|
||||
* `TXT`
|
||||
|
||||
Underlying provider support for each of these varies and some providers have extra requirements or limitations. In cases where a record type is not supported by a provider OctoDNS will ignore it there and continue to manage the record elsewhere. For example `SSHFP` is supported by Dyn, but not Route53. If your source data includes an SSHFP record OctoDNS will keep it in sync on Dyn, but not consider it when evaluating the state of Route53. The best way to find out what types are supported by a provider is to look for its `supports` method. If that method exists the logic will drive which records are supported and which are ignored. If the provider does not implement the method it will fall back to `BaseProvider.supports` which indicates full support.
|
||||
@@ -82,3 +84,37 @@ In the above example each name had a single record, but there are cases where a
|
||||
Each record type has a corresponding set of required data. The easiest way to determine what's required is probably to look at the record object in [`octodns/record/__init__.py`](/octodns/record/__init__.py). You may also utilize `octodns-validate` which will throw errors about what's missing when run.
|
||||
|
||||
`type` is required for all records. `ttl` is optional. When TTL is not specified the `YamlProvider`'s default will be used. In any situation where an array of `values` can be used you can opt to go with `value` as a single item if there's only one.
|
||||
|
||||
### Lenience
|
||||
|
||||
octoDNS is fairly strict in terms of standards compliance and is opinionated in terms of best practices. Examples of former include SRV record naming requirements and the latter that ALIAS records are constrained to the root of zones. The strictness and support of providers varies so you may encounter existing records that fail validation when you try to dump them or you may even have use cases for which you need to create or preserve records that don't validate. octoDNS's solution to this is the `lenient` flag.
|
||||
|
||||
#### octodns-dump
|
||||
|
||||
If you're trying to import a zone into octoDNS config file using `octodns-dump` which fails due to validation errors you can supply the `--lenient` argument to tell octoDNS that you acknowledge that things aren't lining up with its expectations, but you'd like it to go ahead anyway. This will do its best to populate the zone and dump the results out into an octoDNS zone file and include the non-compliant bits. If you go to use that config file octoDNS will again complain about the validation problems. You can correct them in cases where that makes sense, but if you need to preserve the non-compliant records read on for options.
|
||||
|
||||
#### Record level lenience
|
||||
|
||||
When there are non-compliant records configured in Yaml you can add the following to tell octoDNS to do it's best to proceed with them anyway. If you use `--lenient` above to dump a zone and you'd like to sync it as-is you can mark the problematic records this way.
|
||||
|
||||
```yaml
|
||||
'not-root':
|
||||
octodns:
|
||||
lenient: true
|
||||
type: ALIAS
|
||||
values: something.else.com.
|
||||
```
|
||||
|
||||
#### Zone level lenience
|
||||
|
||||
If you'd like to enable lenience for a whole zone you can do so with the following, thought it's strongly encouraged to mark things at record level when possible. The most common case where things may need to be done at the zone level is when using something other than `YamlProvider` as a source, e.g. syncing from `Route53Provider` to `Ns1Provider` when there are non-compliant records in the zone in Route53.
|
||||
|
||||
```yaml
|
||||
non-compliant-zone.com.:
|
||||
octodns:
|
||||
lenient: true
|
||||
sources:
|
||||
- route53
|
||||
targets:
|
||||
- ns1
|
||||
```
|
||||
|
Reference in New Issue
Block a user