propellor spin

This commit is contained in:
Joey Hess 2014-04-23 16:21:38 -04:00
parent b2341697cc
commit 4e65793674
Failed to extract signature
1 changed files with 5 additions and 5 deletions

View File

@ -50,8 +50,7 @@ import Data.List
-- 2. By looking for NS Records in the passed list of records. -- 2. By looking for NS Records in the passed list of records.
-- --
-- In either case, the secondary dns server Host should have an ipv4 and/or -- In either case, the secondary dns server Host should have an ipv4 and/or
-- ipv6 property defined. Propellor will warn if it cannot find the IP -- ipv6 property defined.
-- address for any secondary.
primary :: [Host] -> Domain -> SOA -> [(BindDomain, Record)] -> RevertableProperty primary :: [Host] -> Domain -> SOA -> [(BindDomain, Record)] -> RevertableProperty
primary hosts domain soa rs = RevertableProperty setup cleanup primary hosts domain soa rs = RevertableProperty setup cleanup
where where
@ -79,13 +78,14 @@ primary hosts domain soa rs = RevertableProperty setup cleanup
, confFile = zonefile , confFile = zonefile
, confMasters = [] , confMasters = []
, confAllowTransfer = nub $ , confAllowTransfer = nub $
concatMap (\h -> hostAddresses h hosts) secondaries concatMap (\h -> hostAddresses h hosts) $
secondaries ++ nssecondaries
, confLines = [] , confLines = []
} }
secondaries = otherServers Secondary hosts domain ++ secondaries = otherServers Secondary hosts domain
mapMaybe (domainHostName <=< getNS) rootRecords
secondarywarnings = map (\h -> "No IP address defined for DNS seconary " ++ h) $ secondarywarnings = map (\h -> "No IP address defined for DNS seconary " ++ h) $
filter (\h -> null (hostAddresses h hosts)) secondaries filter (\h -> null (hostAddresses h hosts)) secondaries
nssecondaries = mapMaybe (domainHostName <=< getNS) rootRecords
rootRecords = map snd $ rootRecords = map snd $
filter (\(d, _r) -> d == RootDomain || d == AbsDomain domain) rs filter (\(d, _r) -> d == RootDomain || d == AbsDomain domain) rs
needupdate = do needupdate = do