From 5102b7863b09e58bdd712c9019885313270299ce Mon Sep 17 00:00:00 2001
From: intrigeri <intrigeri@boum.org>
Date: Wed, 29 Jun 2016 15:49:22 +0000
Subject: Drop apt::cron::download, and turn $apt_cron_hours into a class
 parameter for apt::cron::dist_upgrade.

I've introduced apt::cron::download, am not using it anymore, and have
never seen anyone else submit a bug or a merge request for it. Thus,
I feel pretty confident in dropping it.

And this allows me to trivially get rid of the $apt_cron_hours global
variable noticed by LeLutin in #13.
---
 manifests/cron/base.pp         | 20 --------------------
 manifests/cron/dist_upgrade.pp | 21 ++++++++++++++++++++-
 manifests/cron/download.pp     | 27 ---------------------------
 3 files changed, 20 insertions(+), 48 deletions(-)
 delete mode 100644 manifests/cron/base.pp
 delete mode 100644 manifests/cron/download.pp

(limited to 'manifests')

diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp
deleted file mode 100644
index 39fc306..0000000
--- a/manifests/cron/base.pp
+++ /dev/null
@@ -1,20 +0,0 @@
-class apt::cron::base {
-
-  package { 'cron-apt': ensure => installed }
-
-  case $apt_cron_hours {
-    '': {}
-    default: {
-      # cron-apt defaults to run every night at 4 o'clock
-      # so we try not to run at the same time.
-      cron { 'apt_cron_every_N_hours':
-        command => 'test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt',
-        user    => root,
-        hour    => "${apt_cron_hours}",
-        minute  => 10,
-        require => Package['cron-apt'],
-      }
-    }
-  }
-
-}
diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp
index 74403bb..e1a03ed 100644
--- a/manifests/cron/dist_upgrade.pp
+++ b/manifests/cron/dist_upgrade.pp
@@ -1,4 +1,23 @@
-class apt::cron::dist_upgrade inherits apt::cron::base {
+class apt::cron::dist_upgrade (
+  $cron_hours = '',
+) {
+
+  package { 'cron-apt': ensure => installed }
+
+  case $cron_hours {
+    '': {}
+    default: {
+      # cron-apt defaults to run every night at 4 o'clock
+      # so we try not to run at the same time.
+      cron { 'apt_cron_every_N_hours':
+        command => 'test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt',
+        user    => root,
+        hour    => "${cron_hours}",
+        minute  => 10,
+        require => Package['cron-apt'],
+      }
+    }
+  }
 
   $action = "autoclean -y
 dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-confold'
diff --git a/manifests/cron/download.pp b/manifests/cron/download.pp
deleted file mode 100644
index 4a19fec..0000000
--- a/manifests/cron/download.pp
+++ /dev/null
@@ -1,27 +0,0 @@
-class apt::cron::download inherits apt::cron::base {
-
-  $action = "autoclean -y
-dist-upgrade -d -y -o APT::Get::Show-Upgraded=true
-"
-
-  file { '/etc/cron-apt/action.d/4-dist-upgrade':
-    ensure => absent,
-  }
-
-  file { '/etc/cron-apt/action.d/3-download':
-    content => $action,
-    require => Package[cron-apt],
-    owner   => root,
-    group   => 0,
-    mode    => '0644';
-  }
-
-  file { '/etc/cron-apt/config.d/MAILON':
-    content => "MAILON=changes\n",
-    require => Package[cron-apt],
-    owner   => root,
-    group   => 0,
-    mode    => '0644';
-  }
-
-}
-- 
cgit v1.2.3