diff options
-rw-r--r-- | manifests/init.pp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 77d5a7f..85911bc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -181,6 +181,26 @@ class apt { require => File[$seedfile], } } + + define 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" ], + } + } + } + } } class dselect { |