From a7045f737efe76c7346a1ac34f10d0d8d311ff89 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 Jun 2015 14:51:56 -0400 Subject: propellor spin --- src/Propellor/Property/Systemd.hs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index 21b66cb8..973314ac 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -24,7 +24,9 @@ module Propellor.Property.Systemd ( resolvConfed, publish, Proto(..), - publish' + publish', + bind, + bindRo, ) where import Propellor @@ -274,6 +276,8 @@ containerCfg p = RevertableProperty (mk True) (mk False) ('-':_) -> p _ -> "--" ++ p + + -- | Bind mounts from the host into the container. -- -- This property is enabled by default. Revert it to disable it. @@ -310,3 +314,14 @@ publish' proto hostport containerport = containerCfg $ "--port=" ++ where sproto TCP = "tcp" sproto UDP = "udp" + +-- | Bind mount a file or directory from the host into the container. +-- +-- The parameter can be a FilePath, or a colon-separated pair of +-- hostpath:containerpath. +bind :: FilePath -> RevertableProperty +bind f = containerCfg $ "--bind=" ++ f + +-- | Read-only mind mount. +bindRo :: FilePath -> RevertableProperty +bindRo f = containerCfg $ "--bind-ro=" ++ f -- cgit v1.2.3