summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2015-08-31 13:51:29 -0700
committerJoey Hess2015-08-31 13:51:29 -0700
commitda0c883b6aee079a699148b5106199946f7beba7 (patch)
treed700cfd180f8fd0b2492fc017788467d59c6dd78 /src
parente413bed2c1cb15dcb8ce721a2801021e39f3ba86 (diff)
parent1dc00771c7af13ae5b07de55c540b58187340e4e (diff)
Merge branch 'joeyconfig' of ssh://propellor.branchable.com
Diffstat (limited to 'src')
-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