diff options
| author | Joey Hess <joey@kitenet.net> | 2014-05-31 17:22:35 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-05-31 17:22:35 -0400 |
| commit | c742c2eb1b7141fbe0628870e899d3461a88686a (patch) | |
| tree | 517abf211851134fb11150393d3817165a1c7a67 /src/Propellor/Property | |
| parent | 6383d8c38893c160382eb9bf69e0315c5e87269e (diff) | |
propellor spin
Diffstat (limited to 'src/Propellor/Property')
| -rw-r--r-- | src/Propellor/Property/Docker.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index 465fe0b4..c1340ad9 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -46,9 +46,10 @@ type ContainerName = String -- > & Apt.installed {"apache2"] -- > & ... container :: ContainerName -> Image -> Host -container cn image = Host [] (\_ -> attr) +container cn image = Host hn [] (\_ -> attr) where - attr = (newAttr (cn2hn cn)) { _dockerImage = Just image } + attr = (newAttr hn) { _dockerImage = Just image } + hn = cn2hn cn cn2hn :: ContainerName -> HostName cn2hn cn = cn ++ ".docker" @@ -67,7 +68,7 @@ docked -> ContainerName -> RevertableProperty docked hosts cn = RevertableProperty - (go "docked" setup) + ((maybe id exposeDnsAttrs mhost) (go "docked" setup)) (go "undocked" teardown) where go desc a = property (desc ++ " " ++ cn) $ do @@ -95,7 +96,7 @@ docked hosts cn = RevertableProperty ] exposeDnsAttrs :: Host -> Property -> Property -exposeDnsAttrs (Host _ containerattr) p = combineProperties (propertyDesc p) $ +exposeDnsAttrs (Host _ _ containerattr) p = combineProperties (propertyDesc p) $ p : map addDNS (S.toList containerdns) where containerdns = _dns $ containerattr $ newAttr undefined |
