summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Systemd.hs
diff options
context:
space:
mode:
authorJoey Hess2015-08-31 10:16:51 -0700
committerJoey Hess2015-08-31 10:16:51 -0700
commit6c7800a0380d62ae9cdc385625053fe656aebcb1 (patch)
tree905d90a6b76ef5c61bde014e435c4890769d8cfb /src/Propellor/Property/Systemd.hs
parent89dec139eef3d409c06877d5e8fd1dc1085465d1 (diff)
Update for Debian systemd-container package split.
Diffstat (limited to 'src/Propellor/Property/Systemd.hs')
-rw-r--r--src/Propellor/Property/Systemd.hs17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs
index 5c8a35e3..4da5b3f2 100644
--- a/src/Propellor/Property/Systemd.hs
+++ b/src/Propellor/Property/Systemd.hs
@@ -20,7 +20,8 @@ module Propellor.Property.Systemd (
-- * Journal
persistentJournal,
journaldConfigured,
- -- * Containers
+ -- * Containers and machined
+ machined,
MachineName,
Container,
container,
@@ -160,6 +161,18 @@ journaldConfigured option value =
configured "/etc/systemd/journald.conf" option value
`onChange` restarted journald
+-- | Ensures machined and machinectl are installed
+machined :: Property NoInfo
+machined = go `describe` "machined installed"
+ where
+ go = withOS ("standard sources.list") $ \o ->
+ case o of
+ -- Split into separate debian package since systemd 225.
+ (Just (System (Debian suite) _))
+ | not (isStable suite) -> ensureProperty $
+ Apt.installed ["systemd-container"]
+ _ -> noChange
+
-- | Defines a container with a given machine name.
--
-- Properties can be added to configure the Container.
@@ -250,7 +263,7 @@ nspawnService (Container name _ _) cfg = setup <!> teardown
`requires` daemonReloaded
`requires` writeservicefile
- setup = started service `requires` setupservicefile
+ setup = started service `requires` setupservicefile `requires` machined
teardown = check (doesFileExist servicefile) $
disabled service `requires` stopped service