diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-18 17:19:28 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-18 17:19:28 -0400 |
| commit | 39d697ca789c04da07bb14cc7476899e717d9413 (patch) | |
| tree | 9e2c45e9f66e9a7d7e419cb6c38e37e1a9ebdd88 /Propellor/Attr.hs | |
| parent | 2b9ee5b29b03a4a18fb43dafab38d6d185c653e0 (diff) | |
add dns records to Attr
Diffstat (limited to 'Propellor/Attr.hs')
| -rw-r--r-- | Propellor/Attr.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Propellor/Attr.hs b/Propellor/Attr.hs index 03c882cc..21736588 100644 --- a/Propellor/Attr.hs +++ b/Propellor/Attr.hs @@ -4,6 +4,7 @@ module Propellor.Attr where import Propellor.Types import Propellor.Types.Attr +import Propellor.Types.Dns import "mtl" Control.Monad.Reader import qualified Data.Set as S @@ -28,15 +29,16 @@ getOS :: Propellor (Maybe System) getOS = asks _os cname :: Domain -> Property -cname domain = pureAttrProperty ("cname " ++ domain) (addCName domain) +cname domain = pureAttrProperty ("cname " ++ domain) + (addDNS $ CNAME $ AbsDomain domain) cnameFor :: Domain -> (Domain -> Property) -> Property cnameFor domain mkp = let p = mkp domain - in p { propertyAttr = propertyAttr p . addCName domain } + in p { propertyAttr = propertyAttr p . addDNS (CNAME $ AbsDomain domain) } -addCName :: HostName -> SetAttr -addCName domain d = d { _cnames = S.insert domain (_cnames d) } +addDNS :: Record -> SetAttr +addDNS record d = d { _dns = S.insert record (_dns d) } sshPubKey :: String -> Property sshPubKey k = pureAttrProperty ("ssh pubkey known") $ |
