From 21bb63ab58fe4fde0bc9ff15e1e98dcacc2f845b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Apr 2014 23:29:01 -0400 Subject: [PATCH] add SOA --- Propellor/Property/Dns.hs | 7 +++++++ Propellor/Types/Dns.hs | 1 + 2 files changed, 8 insertions(+) diff --git a/Propellor/Property/Dns.hs b/Propellor/Property/Dns.hs index e4dfb19..7abeb55 100644 --- a/Propellor/Property/Dns.hs +++ b/Propellor/Property/Dns.hs @@ -141,6 +141,7 @@ rField (CNAME _) = "CNAME" rField (MX _ _) = "MX" rField (NS _) = "NS" rField (TXT _) = "TXT" +rField (SRV _ _ _ _) = "SRV" rValue :: Record -> String rValue (Address (IPv4 addr)) = addr @@ -148,6 +149,12 @@ rValue (Address (IPv6 addr)) = addr rValue (CNAME d) = dValue d rValue (MX pri d) = show pri ++ " " ++ dValue d rValue (NS d) = dValue d +rValue (SRV priority weight port target) = unwords + [ show priority + , show weight + , show port + , dValue target + ] rValue (TXT s) = [q] ++ filter (/= q) s ++ [q] where q = '"' diff --git a/Propellor/Types/Dns.hs b/Propellor/Types/Dns.hs index 3bdd6c3..9d801ef 100644 --- a/Propellor/Types/Dns.hs +++ b/Propellor/Types/Dns.hs @@ -57,6 +57,7 @@ data Record | MX Int BindDomain | NS BindDomain | TXT String + | SRV Word16 Word16 Word16 BindDomain deriving (Read, Show, Eq, Ord) getIPAddr :: Record -> Maybe IPAddr