summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Apt.hs
diff options
context:
space:
mode:
authorFélix Sipma2016-04-05 18:04:49 +0200
committerFélix Sipma2016-04-05 18:04:49 +0200
commit6512717f2e0e9d58b89501ba2e08c117a0486e9e (patch)
tree4f509d87db29d848d267e9879ed79ac2c8265fac /src/Propellor/Property/Apt.hs
parent320fd857a7b8dd1ec1173740819b074f21b077b0 (diff)
Apt: add periodicUpdates
Diffstat (limited to 'src/Propellor/Property/Apt.hs')
-rw-r--r--src/Propellor/Property/Apt.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index 5771750d..fd70e37d 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -258,6 +258,15 @@ unattendedUpgrades = enable <!> disable
("Unattended-Upgrade::Origins-Pattern { \"o=Debian,a="++showSuite suite++"\"; };")
_ -> noChange
+-- | Enable periodic updates.
+periodicUpdates :: Property DebianLike
+periodicUpdates = tightenTargets $ "/etc/apt/apt.conf.d/02periodic" `File.hasContent`
+ [ "APT::Periodic::Enable \"1\";"
+ , "APT::Periodic::Update-Package-Lists \"1\";"
+ , "APT::Periodic::Download-Upgradeable-Packages \"1\";"
+ , "APT::Periodic::Verbose \"1\";"
+ ]
+
type DebconfTemplate = String
type DebconfTemplateType = String
type DebconfTemplateValue = String
@@ -265,8 +274,8 @@ type DebconfTemplateValue = String
-- | Preseeds debconf values and reconfigures the package so it takes
-- effect.
reConfigure :: Package -> [(DebconfTemplate, DebconfTemplateType, DebconfTemplateValue)] -> Property DebianLike
-reConfigure package vals = tightenTargets $
- reconfigure
+reConfigure package vals = tightenTargets $
+ reconfigure
`requires` setselections
`describe` ("reconfigure " ++ package)
where