From 0f022f07523a2221d527c705caff2a2d8cc83a03 Mon Sep 17 00:00:00 2001 From: FĂ©lix Sipma Date: Sun, 1 Apr 2018 22:43:20 +0200 Subject: Unbound: handle missing records --- src/Propellor/Property/Unbound.hs | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/Unbound.hs b/src/Propellor/Property/Unbound.hs index 0d057924..a17e5dd4 100644 --- a/src/Propellor/Property/Unbound.hs +++ b/src/Propellor/Property/Unbound.hs @@ -126,19 +126,36 @@ genRecord dom (PTR revip) = Just $ unwords , "PTR" , dValue dom ] -genRecord _ (CNAME _) = Nothing -genRecord _ (NS _) = Nothing -genRecord _ (TXT _) = Nothing +genRecord dom (CNAME dest) = Just $ unwords + [ dValue dom + , "CNAME" + , dValue dest + ] +genRecord dom (NS serv) = Just $ unwords + [ dValue dom + , "NS" + , dValue serv + ] +genRecord dom (TXT txt) = Just $ unwords + [ dValue dom + , "TXT" + , txt + ] genRecord dom (SRV priority weight port target) = Just $ unwords [ dValue dom - , "IN" , "SRV" , val priority , val weight , val port , dValue target ] -genRecord _ (SSHFP _ _ _) = Nothing +genRecord dom (SSHFP algo hash fingerprint) = Just $ unwords + [ dValue dom + , "SSHFP" + , val algo + , val hash + , fingerprint + ] genRecord _ (INCLUDE _) = Nothing genAddressNoTtl :: BindDomain -> IPAddr -> String -- cgit v1.2.3