SaltDns. Proxy. AddressPlan
(Salt v1.0.0)
Which address records a proxy group should have in the zones, and what to
write to get there. Pure: the caller reads the zone and the ownership rows
and applies the operations (SaltDns.Proxy.Addresses).
The names
The group's address names are the hosts of its routes that have
publish_address on, plus the extra names added to the group. A wildcard
route *.x.example.org is the record *.x.example.org. A name is placed in
the zone with the longest matching name (locate/2); a name in no zone of the
organisation is not an address name when it comes from a route and is shown
as refused when it was added by hand.
Safety
The plan never touches what it did not write:
- Ownership is a row per (zone, name, type) naming the group and the
records written (
SaltDns.Proxy.PublishedRecord). A record set counts as ours only while its records are still exactly those, with none disabled. Anyone who edited it owns it from then on. - A name with an A, AAAA or CNAME record set that is not ours is a conflict: nothing at that name is written, merged or removed, and the conflict reports what is there.
- A name at or below a delegation inside the zone (an NS record set below the apex) is refused. The apex itself is allowed.
- A name that is no longer wanted (route removed, flag off, extra name removed, setting off) loses exactly the record sets that are ours.
Summary
Functions
True when name is at or below a delegation of the zone: an NS record set at
a name below the apex that is the name or one of its parents. rrsets is the
zone's record sets keyed by {name, type}.
The zone with the longest name that holds name, or nil.
The address names of a group: [%{name:, sources: [:route | :extra]}], sorted.
routes are maps with host and publish_address; extras are names.
The plan for one zone.
Types
Functions
True when name is at or below a delegation of the zone: an NS record set at
a name below the apex that is the name or one of its parents. rrsets is the
zone's record sets keyed by {name, type}.
The zone with the longest name that holds name, or nil.
The address names of a group: [%{name:, sources: [:route | :extra]}], sorted.
routes are maps with host and publish_address; extras are names.
The plan for one zone.
group_id,zone,rrsets,ownership(the rows of this zone)wanted: the address names (names/2) thatlocate/2put in this zonedesired:{:publish, %{"A" => [..], "AAAA" => [..]}}(fromSaltDns.Proxy.Answer) or:keep_lastttl: the TTL for the sets written
Returns %{statuses: %{name => status}, ops: [op], own: [{name, type}], release: [{name, type}]}. ops are the zone mutation operations
(SaltDns.Zones); own are the sets to record as ours after writing them
(the caller reads the stored records back), release the ownership rows
to drop.