]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
[refactor] Get rid of the disable_update parameter
authorvarac <varacanero@zeromail.org>
Tue, 26 Jan 2016 14:18:22 +0000 (15:18 +0100)
committervarac <varacanero@zeromail.org>
Mon, 1 Feb 2016 19:42:37 +0000 (20:42 +0100)
The `disable_update` parameter has been removed. The main apt class
defaults to *not* run an `apt-get update` on every run anyway so
this parameter seems useless.
You can include the `apt::update` class if you want it to be
run every time.

manifests/init.pp
manifests/params.pp
manifests/upgrade_package.pp

index d6e75cc408ee4b47752600711f9a4a4301f4d0ed..85f44f0643a717242fea358af9306408f7ac9ac0 100644 (file)
@@ -18,7 +18,6 @@ class apt(
   $repos = $apt::params::repos,
   $custom_preferences = $apt::params::custom_preferences,
   $custom_sources_list = '',
-  $disable_update = $apt::params::disable_update,
   $custom_key_dir = $apt::params::custom_key_dir
 ) inherits apt::params {
   case $::operatingsystem {
index 28da13e901c539c27a5d32521da11260e82a1a7c..28af06eb50470e58675051c4ca2f7237d36087b2 100644 (file)
@@ -18,6 +18,5 @@ class apt::params () {
   $volatile_url = 'http://volatile.debian.org/debian-volatile/'
   $repos = 'auto'
   $custom_preferences = ''
-  $disable_update = false
   $custom_key_dir = false
 }
index d607150aa9af6d80a747c3b8bf877f37cfe611f6..30572c96bb84d401e39caffa56ba5bb32f64573c 100644 (file)
@@ -2,10 +2,6 @@ define apt::upgrade_package (
   $version = ''
 ) {
 
-  if $apt::disable_update == false {
-    include apt::update
-  }
-
   $version_suffix = $version ? {
     ''       => '',
     'latest' => '',
@@ -26,17 +22,10 @@ define apt::upgrade_package (
     }
   }
 
-  $req = $apt::disable_update ? {
-    true    => Package['apt-show-versions', 'dctrl-tools'],
-    default => [
-                Exec['apt_updated'],
-                Package['apt-show-versions', 'dctrl-tools']
-              ],
-  }
-
   exec { "apt-get -q -y -o 'DPkg::Options::=--force-confold' install ${name}${version_suffix}":
     onlyif  => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
-    require => $req
+    require => Package['apt-show-versions', 'dctrl-tools'],
+    before  => Exec['apt_updated']
   }
 
 }