module-apt/manifests/upgrade_package.pp

25 lines
567 B
ObjectPascal
Raw Normal View History

2009-10-30 20:20:42 +01:00
define apt::upgrade_package ($version = "") {
2010-12-07 19:18:41 +01:00
include apt::update
$version_suffix = $version ? {
'' => '',
'latest' => '',
default => "=${version}",
}
2010-12-15 15:18:16 +01:00
package { ['apt-show-versions', 'dctrl-tools']:
ensure => installed,
require => undef,
}
exec { "aptitude -y install ${name}${version_suffix}":
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
require => [
Exec['apt_updated'],
Package['apt-show-versions', 'dctrl-tools'],
],
2009-10-30 20:20:42 +01:00
}
2009-10-30 20:20:42 +01:00
}