module-apt/manifests/upgrade_package.pp
intrigeri 4979889584 (ugly workaround warning) Update packages lists before upgrading a package.
... because Exec[update_apt] is currently never run since we set it refreshonly.
Better solutions are being thought of, but in the meantime the least we can do
is somehow repair apt::upgrade_package.
2010-12-14 22:04:05 +01:00

15 lines
529 B
Puppet

define apt::upgrade_package ($version = "") {
case $version {
'', 'latest': {
exec { "/usr/bin/apt-get update && aptitude -y install $name":
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":
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
}
}
}
}