summaryrefslogtreecommitdiff
path: root/Propellor/Property
diff options
context:
space:
mode:
authorJoey Hess2014-04-19 13:17:25 -0400
committerJoey Hess2014-04-19 13:17:25 -0400
commit86e7e4e58ede056284e076756159990657433ec8 (patch)
treecaae10627c646efb99aab5f9f52366077501fe5b /Propellor/Property
parenta2ef91929a19c4b70877691a66074fc42a9488ea (diff)
When unattendedUpgrades is enabled on an Unstable or Testing system, configure it to allow the upgrades.
Diffstat (limited to 'Propellor/Property')
-rw-r--r--Propellor/Property/Apt.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/Propellor/Property/Apt.hs b/Propellor/Property/Apt.hs
index 9234cbbf..7329c7a8 100644
--- a/Propellor/Property/Apt.hs
+++ b/Propellor/Property/Apt.hs
@@ -192,7 +192,9 @@ autoRemove = runApt ["-y", "autoremove"]
unattendedUpgrades :: RevertableProperty
unattendedUpgrades = RevertableProperty enable disable
where
- enable = setup True `before` Service.running "cron"
+ enable = setup True
+ `before` Service.running "cron"
+ `before` configure
disable = setup False
setup enabled = (if enabled then installed else removed) ["unattended-upgrades"]
@@ -203,6 +205,16 @@ unattendedUpgrades = RevertableProperty enable disable
v
| enabled = "true"
| otherwise = "false"
+
+ configure = withOS "unattended upgrades configured" $ \o ->
+ case o of
+ -- the package defaults to only upgrading stable
+ (Just (System (Debian suite) _))
+ | not (isStable suite) -> ensureProperty $
+ "/etc/apt/apt.conf.d/50unattended-upgrades"
+ `File.containsLine`
+ ("\t\"o=Debian,a="++showSuite suite++"\";")
+ _ -> noChange
-- | Preseeds debconf values and reconfigures the package so it takes
-- effect.