add linkJournal property so it can be reverted to disable
This commit is contained in:
parent
b4503a782b
commit
6d36de695c
|
@ -22,6 +22,7 @@ module Propellor.Property.Systemd (
|
||||||
-- * Container configuration
|
-- * Container configuration
|
||||||
containerCfg,
|
containerCfg,
|
||||||
resolvConfed,
|
resolvConfed,
|
||||||
|
linkJournal,
|
||||||
privateNetwork,
|
privateNetwork,
|
||||||
ForwardedPort(..),
|
ForwardedPort(..),
|
||||||
Proto(..),
|
Proto(..),
|
||||||
|
@ -136,6 +137,7 @@ container :: MachineName -> (FilePath -> Chroot.Chroot) -> Container
|
||||||
container name mkchroot = Container name c h
|
container name mkchroot = Container name c h
|
||||||
& os system
|
& os system
|
||||||
& resolvConfed
|
& resolvConfed
|
||||||
|
& linkJournal
|
||||||
where
|
where
|
||||||
c@(Chroot.Chroot _ system _ _) = mkchroot (containerDir name)
|
c@(Chroot.Chroot _ system _ _) = mkchroot (containerDir name)
|
||||||
h = Host name [] mempty
|
h = Host name [] mempty
|
||||||
|
@ -207,7 +209,6 @@ nspawnService (Container name _ _) cfg = setup <!> teardown
|
||||||
, "--quiet"
|
, "--quiet"
|
||||||
, "--keep-unit"
|
, "--keep-unit"
|
||||||
, "--boot"
|
, "--boot"
|
||||||
, "--link-journal=try-guest"
|
|
||||||
, "--directory=/var/lib/container/%i"
|
, "--directory=/var/lib/container/%i"
|
||||||
] ++ nspawnServiceParams cfg
|
] ++ nspawnServiceParams cfg
|
||||||
| otherwise = l
|
| otherwise = l
|
||||||
|
@ -302,6 +303,13 @@ containerCfg p = RevertableProperty (mk True) (mk False)
|
||||||
resolvConfed :: RevertableProperty
|
resolvConfed :: RevertableProperty
|
||||||
resolvConfed = containerCfg "bind=/etc/resolv.conf"
|
resolvConfed = containerCfg "bind=/etc/resolv.conf"
|
||||||
|
|
||||||
|
-- | Link the container's journal to the host's if possible.
|
||||||
|
-- (Only works if the host has persistent journal enabled.)
|
||||||
|
--
|
||||||
|
-- This property is enabled by default. Revert it to disable it.
|
||||||
|
linkJournal :: RevertableProperty
|
||||||
|
linkJournal = containerCfg "link-journal=try-guest"
|
||||||
|
|
||||||
-- | Disconnect networking of the container from the host.
|
-- | Disconnect networking of the container from the host.
|
||||||
privateNetwork :: RevertableProperty
|
privateNetwork :: RevertableProperty
|
||||||
privateNetwork = containerCfg "private-network"
|
privateNetwork = containerCfg "private-network"
|
||||||
|
|
Loading…
Reference in New Issue