propellor

propellor config for hosts.
git clone git://git.ricketyspace.net/propellor.git
Log | Files | Refs | LICENSE

commit 51f6d7ae0f7062814d36dc04608e5fffe8305b5c
parent dcd21ce8a7733eea182c65a0774a7f1a67b3cc56
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun, 17 Jun 2018 04:04:42 +0000

src: Add MTXT DNS record type.

Very rough. Snafu.

Diffstat:
src/Propellor/Property/Dns.hs | 8++++++++
src/Propellor/Property/Unbound.hs | 1+
src/Propellor/Types/Dns.hs | 1+
3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/Propellor/Property/Dns.hs b/src/Propellor/Property/Dns.hs @@ -23,6 +23,7 @@ import qualified Propellor.Property.Service as Service import Propellor.Property.Scheduled import Propellor.Property.DnsSec import Utility.Applicative +import Utility.Split import qualified Data.Map as M import qualified Data.Set as S @@ -298,6 +299,7 @@ rField (CNAME _) = Just "CNAME" rField (MX _ _) = Just "MX" rField (NS _) = Just "NS" rField (TXT _) = Just "TXT" +rField (MTXT _) = Just "TXT" rField (SRV _ _ _ _) = Just "SRV" rField (SSHFP _ _ _) = Just "SSHFP" rField (INCLUDE _) = Just "$INCLUDE" @@ -324,6 +326,12 @@ rValue (INCLUDE f) = Just f rValue (TXT s) = Just $ [q] ++ filter (/= q) s ++ [q] where q = '"' +rValue (MTXT s) = Just $ [p] ++ [w] ++ (intercalate "\n\t" $ map (\x -> [q] ++ x ++ [q]) $ splitc n s) ++ [w] ++ [p] + where + p = '(' + w = ' ' + q = '"' + n = '\n' rValue (PTR _) = Nothing -- | Adjusts the serial number of the zone to always be larger diff --git a/src/Propellor/Property/Unbound.hs b/src/Propellor/Property/Unbound.hs @@ -120,6 +120,7 @@ genRecord dom (PTR revip) = Just $ genPTR dom revip genRecord _ (CNAME _) = Nothing genRecord _ (NS _) = Nothing genRecord _ (TXT _) = Nothing +genRecord _ (MTXT _) = Nothing genRecord _ (SRV _ _ _ _) = Nothing genRecord _ (SSHFP _ _ _) = Nothing genRecord _ (INCLUDE _) = Nothing diff --git a/src/Propellor/Types/Dns.hs b/src/Propellor/Types/Dns.hs @@ -113,6 +113,7 @@ data Record | MX Int BindDomain | NS BindDomain | TXT String + | MTXT String | SRV Word16 Word16 Word16 BindDomain | SSHFP Int Int String | INCLUDE FilePath