summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Aiccu.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-25 18:39:50 -0400
committerJoey Hess2016-03-25 18:39:50 -0400
commitce8d34d094be30e1432ecaaae81b188671180624 (patch)
tree289e2bba5ca5291c14255c5b5fe6cf6d007a1bcf /src/Propellor/Property/Aiccu.hs
parent860d1dd77e1789a91ed61bdceab667d94c9bd345 (diff)
ported more
Ssh is WIP and failing to compile quite badly
Diffstat (limited to 'src/Propellor/Property/Aiccu.hs')
-rw-r--r--src/Propellor/Property/Aiccu.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Propellor/Property/Aiccu.hs b/src/Propellor/Property/Aiccu.hs
index 47841a7b..1b28759c 100644
--- a/src/Propellor/Property/Aiccu.hs
+++ b/src/Propellor/Property/Aiccu.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE TypeFamilies #-}
+
-- | Maintainer: Jelmer Vernooij <jelmer@samba.org>
module Propellor.Property.Aiccu (
@@ -14,10 +16,10 @@ import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.Service as Service
import qualified Propellor.Property.File as File
-installed :: Property NoInfo
+installed :: Property DebianLike
installed = Apt.installed ["aiccu"]
-restarted :: Property NoInfo
+restarted :: Property DebianLike
restarted = Service.restarted "aiccu"
confPath :: FilePath
@@ -41,12 +43,12 @@ config u t p =
-- | Configures an ipv6 tunnel using sixxs.net, with the given TunneId
-- and sixx.net UserName.
-hasConfig :: TunnelId -> UserName -> Property HasInfo
-hasConfig t u = prop `onChange` restarted
+hasConfig :: TunnelId -> UserName -> Property (HasInfo + DebianLike)
+hasConfig t u = prop `onChange` restarted
where
+ prop :: Property (HasInfo + UnixLike)
prop = withSomePrivData [(Password (u++"/"++t)), (Password u)] (Context "aiccu") $
- property "aiccu configured" . writeConfig
- writeConfig :: (((PrivDataField, PrivData) -> Propellor Result) -> Propellor Result) -> Propellor Result
- writeConfig getpassword = getpassword $ ensureProperty . go
+ property' "aiccu configured" . writeConfig
+ writeConfig getpassword w = getpassword $ ensureProperty w . go
go (Password u', p) = confPath `File.hasContentProtected` config u' t p
go (f, _) = error $ "Unexpected type of privdata: " ++ show f