Safe Haskell | None |
---|---|
Language | Haskell2010 |
Propellor.Property.Chroot
Contents
Synopsis
- debootstrapped :: DebootstrapConfig -> FilePath -> Props metatypes -> Chroot
- bootstrapped :: ChrootBootstrapper b => b -> FilePath -> Props metatypes -> Chroot
- provisioned :: Chroot -> RevertableProperty (HasInfo + Linux) Linux
- hostChroot :: ChrootBootstrapper bootstrapper => Host -> bootstrapper -> FilePath -> Chroot
- data Chroot where
- Chroot :: ChrootBootstrapper b => FilePath -> b -> InfoPropagator -> Host -> Chroot
- class ChrootBootstrapper b where
- data Debootstrapped = Debootstrapped DebootstrapConfig
- data ChrootTarball = ChrootTarball FilePath
- exposeTrueLocaldir :: (FilePath -> Propellor a) -> Propellor a
- useHostProxy :: Host -> Property DebianLike
- provisioned' :: Chroot -> Bool -> [ContainerCapability] -> RevertableProperty (HasInfo + Linux) Linux
- propagateChrootInfo :: InfoPropagator
- propellChroot :: Chroot -> ([String] -> IO (CreateProcess, IO ())) -> Bool -> [ContainerCapability] -> Property UnixLike
- chain :: [Host] -> CmdLine -> IO ()
- chrootSystem :: Chroot -> Maybe System
Documentation
debootstrapped :: DebootstrapConfig -> FilePath -> Props metatypes -> Chroot Source #
Defines a Chroot at the given location, built with debootstrap.
Properties can be added to configure the Chroot. At a minimum,
add a property such as osDebian
to specify the operating system
to bootstrap.
If the DebootstrapConfig
does not include a
DebootstrapMirror
,
any mirror
property of the chroot will configure debootstrap.
Same for DebootstrapProxy
and proxy
.
debootstrapped Debootstrap.BuildD "/srv/chroot/ghc-dev" $ props & osDebian Unstable X86_64 & Apt.installed ["ghc", "haskell-platform"] & ...
bootstrapped :: ChrootBootstrapper b => b -> FilePath -> Props metatypes -> Chroot Source #
Defines a Chroot at the given location, bootstrapped with the specified ChrootBootstrapper.
Like debootstrapped
, if the ChrootBootstrapper
is
Debootstrapped
, this property respects the Chroot's
proxy
and mirror
properties.
provisioned :: Chroot -> RevertableProperty (HasInfo + Linux) Linux Source #
Ensures that the chroot exists and is provisioned according to its properties.
Reverting this property removes the chroot. Anything mounted inside it is first unmounted. Note that it does not ensure that any processes that might be running inside the chroot are stopped.
hostChroot :: ChrootBootstrapper bootstrapper => Host -> bootstrapper -> FilePath -> Chroot Source #
Generates a Chroot that has all the properties of a Host.
Note that it's possible to create loops using this, where a host contains a Chroot containing itself etc. Such loops will be detected at runtime.
Specification of a chroot. Normally you'll use debootstrapped
or
bootstrapped
or hostChroot
to construct a Chroot value.
Constructors
Chroot :: ChrootBootstrapper b => FilePath -> b -> InfoPropagator -> Host -> Chroot |
Instances
Show Chroot Source # | |
IsContainer Chroot Source # | |
Defined in Propellor.Property.Chroot Methods containerProperties :: Chroot -> [ChildProperty] Source # containerInfo :: Chroot -> Info Source # setContainerProperties :: Chroot -> [ChildProperty] -> Chroot Source # |
class ChrootBootstrapper b where Source #
Class of things that can do initial bootstrapping of an operating System in a chroot.
Methods
Arguments
:: b | |
-> Info | info of the Properties of the chroot |
-> FilePath | where to bootstrap the chroot |
-> Either String (Property Linux) |
Do initial bootstrapping of an operating system in a chroot. If the operating System is not supported, return Left error message.
Instances
ChrootBootstrapper Debootstrapped Source # | |
Defined in Propellor.Property.Chroot Methods buildchroot :: Debootstrapped -> Info -> FilePath -> Either String (Property Linux) Source # | |
ChrootBootstrapper ChrootTarball Source # | |
Defined in Propellor.Property.Chroot Methods buildchroot :: ChrootTarball -> Info -> FilePath -> Either String (Property Linux) Source # |
data Debootstrapped Source #
Use this to bootstrap a chroot with debootstrap.
Constructors
Debootstrapped DebootstrapConfig |
Instances
ChrootBootstrapper Debootstrapped Source # | |
Defined in Propellor.Property.Chroot Methods buildchroot :: Debootstrapped -> Info -> FilePath -> Either String (Property Linux) Source # |
data ChrootTarball Source #
Use this to bootstrap a chroot by extracting a tarball.
The tarball is expected to contain a root directory (no top-level
directory, also known as a "tarbomb").
It may be optionally compressed with any format tar
knows how to
detect automatically.
Constructors
ChrootTarball FilePath |
Instances
ChrootBootstrapper ChrootTarball Source # | |
Defined in Propellor.Property.Chroot Methods buildchroot :: ChrootTarball -> Info -> FilePath -> Either String (Property Linux) Source # |
exposeTrueLocaldir :: (FilePath -> Propellor a) -> Propellor a Source #
Runs an action with the true localdir exposed, not the one bind-mounted into a chroot. The action is passed the path containing the contents of the localdir outside the chroot.
In a chroot, this is accomplished by temporily bind mounting the localdir to a temp directory, to preserve access to the original bind mount. Then we unmount the localdir to expose the true localdir. Finally, to cleanup, the temp directory is bind mounted back to the localdir.
useHostProxy :: Host -> Property DebianLike Source #
Ensure that a chroot uses the host's Apt proxy.
This property is often used for built
chroots, when the host has
useLocalCacher
.
Internal use
provisioned' :: Chroot -> Bool -> [ContainerCapability] -> RevertableProperty (HasInfo + Linux) Linux Source #
propagateChrootInfo :: InfoPropagator Source #
propellChroot :: Chroot -> ([String] -> IO (CreateProcess, IO ())) -> Bool -> [ContainerCapability] -> Property UnixLike Source #
Propellor is run inside the chroot to provision it.