module-apt/manifests/upgrade_package.pp
2009-10-30 20:20:42 +01:00

19 lines
660 B
Puppet

define apt::upgrade_package ($version = "") {
case $version {
'': {
exec { "aptitude -y install $name":
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
}
}
'latest': {
exec { "aptitude -y install $name":
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
}
}
default: {
exec { "aptitude -y install $name=$version":
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
}
}
}
}