ded81d8edc
Signed-off-by: Gabriel Filion <lelutin@gmail.com> + more linting by intrigeri. Conflicts: manifests/apticron.pp manifests/cron/dist_upgrade.pp manifests/cron/download.pp manifests/dist_upgrade/initiator.pp manifests/init.pp manifests/listchanges.pp manifests/preferences.pp manifests/preseeded_package.pp manifests/proxy_client.pp manifests/unattended_upgrades.pp manifests/update.pp
42 linhas
976 B
Puppet
42 linhas
976 B
Puppet
define apt::upgrade_package (
|
|
$version = ''
|
|
) {
|
|
|
|
if $apt::disable_update == false {
|
|
include apt::update
|
|
}
|
|
|
|
$version_suffix = $version ? {
|
|
'' => '',
|
|
'latest' => '',
|
|
default => "=${version}",
|
|
}
|
|
|
|
if !defined(Package['apt-show-versions']) {
|
|
package { 'apt-show-versions':
|
|
ensure => installed,
|
|
require => undef,
|
|
}
|
|
}
|
|
|
|
if !defined(Package['dctrl-tools']) {
|
|
package { 'dctrl-tools':
|
|
ensure => installed,
|
|
require => undef,
|
|
}
|
|
}
|
|
|
|
$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
|
|
}
|
|
|
|
}
|