propellor

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

commit 9f886345f144ca7dc6e333bd4fa62ee6476bfc83
parent fe8a0f04c699da5d9da0f71180776a1943f0496e
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun, 24 Jun 2018 13:48:24 +0000

update rValue of Dns TXT record type

The TXT record's string is split into strings of length <= 255
characters and these strings are enclosed inside a pair of
parentheses.

Signed-off-by: rsiddharth <s@ricketyspace.net>

Diffstat:
src/Propellor/Property/Dns.hs | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/Propellor/Property/Dns.hs b/src/Propellor/Property/Dns.hs @@ -26,6 +26,7 @@ import Utility.Applicative import qualified Data.Map as M import qualified Data.Set as S +import qualified Data.List.Split as Split (chunksOf) import Data.List -- | Primary dns server for a domain, using bind. @@ -321,8 +322,15 @@ rValue (SSHFP x y s) = Just $ unwords , s ] rValue (INCLUDE f) = Just f -rValue (TXT s) = Just $ [q] ++ filter (/= q) s ++ [q] +rValue (TXT s) = Just $ [op] ++ [w] + ++ (intercalate "\n\t" $ + map (\x -> [q] ++ filter (/= q) x ++ [q]) $ + Split.chunksOf 255 s) + ++ [w] ++ [cp] where + op = '(' + cp = ')' + w = ' ' q = '"' rValue (PTR _) = Nothing