From 8b510078365356605bafbd24bf1c09e9bb71194b Mon Sep 17 00:00:00 2001 From: FĂ©lix Sipma Date: Tue, 5 Apr 2016 20:39:19 +0200 Subject: Apt.unattendedUpgrades: mail root --- src/Propellor/Property/Apt.hs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/Propellor/Property/Apt.hs') diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs index 58a83c43..5e185a0e 100644 --- a/src/Propellor/Property/Apt.hs +++ b/src/Propellor/Property/Apt.hs @@ -249,15 +249,21 @@ unattendedUpgrades = enable disable | otherwise = "false" configure :: Property DebianLike - configure = withOS "unattended upgrades configured" $ \w o -> - case o of - -- the package defaults to only upgrading stable - (Just (System (Debian suite) _)) - | not (isStable suite) -> ensureProperty w $ - "/etc/apt/apt.conf.d/50unattended-upgrades" - `File.containsLine` - ("Unattended-Upgrade::Origins-Pattern { \"o=Debian,a="++showSuite suite++"\"; };") - _ -> noChange + configure = propertyList "unattended upgrades configured" $ props + & enableupgrading + & unattendedconfig `File.containsLine` "Unattended-Upgrade::Mail \"root\";" + where + enableupgrading :: Property DebianLike + enableupgrading = withOS "unattended upgrades configured" $ \w o -> + case o of + -- the package defaults to only upgrading stable + (Just (System (Debian suite) _)) + | not (isStable suite) -> ensureProperty w $ + unattendedconfig + `File.containsLine` + ("Unattended-Upgrade::Origins-Pattern { \"o=Debian,a="++showSuite suite++"\"; };") + _ -> noChange + unattendedconfig = "/etc/apt/apt.conf.d/50unattended-upgrades" -- | Enable periodic updates (but not upgrades), including download -- of packages. -- cgit v1.2.3