summaryrefslogtreecommitdiff
path: root/Propellor/Types/Dns.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-18 21:10:44 -0400
committerJoey Hess2014-04-18 21:10:44 -0400
commitc8a3653775892bd361091885c63113b6ca36ed5a (patch)
tree672624a10fc528b9e04ac2ab73db14ccad22e899 /Propellor/Types/Dns.hs
parent8e22065deff41c3e476763ebd939a63856e6d54b (diff)
genZone is working! complete DNS zone file generation from propellor config
Diffstat (limited to 'Propellor/Types/Dns.hs')
-rw-r--r--Propellor/Types/Dns.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Propellor/Types/Dns.hs b/Propellor/Types/Dns.hs
index b5cfcffd..0474ea96 100644
--- a/Propellor/Types/Dns.hs
+++ b/Propellor/Types/Dns.hs
@@ -1,7 +1,5 @@
module Propellor.Types.Dns where
-import Propellor.Types.OS (HostName)
-
import Data.Word
type Domain = String
@@ -28,8 +26,9 @@ data Type = Master | Secondary
-- | Represents a bind 9 zone file.
data Zone = Zone
- { zSOA :: SOA
- , zHosts :: [(HostName, Record)]
+ { zDomain :: Domain
+ , zSOA :: SOA
+ , zHosts :: [(BindDomain, Record)]
}
deriving (Read, Show, Eq)
@@ -64,6 +63,10 @@ getIPAddr :: Record -> Maybe IPAddr
getIPAddr (Address addr) = Just addr
getIPAddr _ = Nothing
+getCNAME :: Record -> Maybe BindDomain
+getCNAME (CNAME d) = Just d
+getCNAME _ = Nothing
+
-- | Bind serial numbers are unsigned, 32 bit integers.
type SerialNumber = Word32