summaryrefslogtreecommitdiff
path: root/src/Propellor/Types
diff options
context:
space:
mode:
authorJoey Hess2014-11-21 18:55:33 -0400
committerJoey Hess2014-11-21 18:55:33 -0400
commit6c92f1034f980718cef54cab58a1bcfdbc485f5d (patch)
tree3a2bacdc7d3433b6326c01e9acf3f9d2101e04b3 /src/Propellor/Types
parent04ea987075b869ea70cf55a193af7f5604ff0561 (diff)
split out info types
Diffstat (limited to 'src/Propellor/Types')
-rw-r--r--src/Propellor/Types/Chroot.hs15
-rw-r--r--src/Propellor/Types/Docker.hs24
2 files changed, 39 insertions, 0 deletions
diff --git a/src/Propellor/Types/Chroot.hs b/src/Propellor/Types/Chroot.hs
new file mode 100644
index 00000000..d4dd6eae
--- /dev/null
+++ b/src/Propellor/Types/Chroot.hs
@@ -0,0 +1,15 @@
+module Propellor.Types.Chroot where
+
+import Data.Monoid
+import qualified Data.Map as M
+
+data ChrootInfo h = ChrootInfo
+ { _chroots :: M.Map FilePath h
+ }
+ deriving (Show)
+
+instance Monoid (ChrootInfo h) where
+ mempty = ChrootInfo mempty
+ mappend old new = ChrootInfo
+ { _chroots = M.union (_chroots old) (_chroots new)
+ }
diff --git a/src/Propellor/Types/Docker.hs b/src/Propellor/Types/Docker.hs
new file mode 100644
index 00000000..42a65923
--- /dev/null
+++ b/src/Propellor/Types/Docker.hs
@@ -0,0 +1,24 @@
+module Propellor.Types.Docker where
+
+import Propellor.Types.OS
+
+import Data.Monoid
+import qualified Data.Map as M
+
+data DockerInfo h = DockerInfo
+ { _dockerRunParams :: [DockerRunParam]
+ , _dockerContainers :: M.Map String h
+ }
+ deriving (Show)
+
+instance Monoid (DockerInfo h) where
+ mempty = DockerInfo mempty mempty
+ mappend old new = DockerInfo
+ { _dockerRunParams = _dockerRunParams old <> _dockerRunParams new
+ , _dockerContainers = M.union (_dockerContainers old) (_dockerContainers new)
+ }
+
+newtype DockerRunParam = DockerRunParam (HostName -> String)
+
+instance Show DockerRunParam where
+ show (DockerRunParam a) = a ""