module-apt/manifests/upgrade_package.pp

16 lines
529 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
2009-10-30 20:20:42 +01:00
case $version {
2010-12-14 21:39:50 +01:00
'', 'latest': {
exec { "/usr/bin/apt-get update && aptitude -y install $name":
2009-10-30 20:20:42 +01:00
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
}
}
default: {
exec { "/usr/bin/apt-get update && aptitude -y install $name=$version":
2009-10-30 20:20:42 +01:00
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
}
}
}
}