diff options
author | varac <varacanero@zeromail.org> | 2016-01-26 15:18:22 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-02-01 20:42:37 +0100 |
commit | 207218cee80ae99845cb567737f14a5eaafc136d (patch) | |
tree | a791341dc47857c790ea55f90b83293efc50b6a2 | |
parent | d2ae98e89b4f1a552eb7464f217aa809ac68666b (diff) | |
download | puppet-apt-207218cee80ae99845cb567737f14a5eaafc136d.tar.gz puppet-apt-207218cee80ae99845cb567737f14a5eaafc136d.tar.bz2 |
[refactor] Get rid of the disable_update parameter
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.
-rw-r--r-- | manifests/init.pp | 1 | ||||
-rw-r--r-- | manifests/params.pp | 1 | ||||
-rw-r--r-- | manifests/upgrade_package.pp | 15 |
3 files changed, 2 insertions, 15 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index d6e75cc..85f44f0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 { diff --git a/manifests/params.pp b/manifests/params.pp index 28da13e..28af06e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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 } diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index d607150..30572c9 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -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'] } } |