From 62e74d9663bdedf50cb77db5cfc843fc940149bc Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Wed, 23 Dec 2015 10:20:44 -0500 Subject: Upgrade all packages after puppet managed ones This updates tripleo::packages so that when enable_upgrade is used it will: 1) upgrade puppet managed packages (will trigger puppet dependencies) 2) then upgrade all packages via exec 3) then restart services NOTE: the intention here is that the Exec['update-packages'] will always execute if enable_upgrade is set. It is not idempotent in this regard because I think we always want to execute it if enable_upgrade is set. Change-Id: I02f7cf07792765359f19fdf357024d9e48690e42 Related-bug: #1522943 --- manifests/packages.pp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/packages.pp b/manifests/packages.pp index ac11efd..c0971e9 100644 --- a/manifests/packages.pp +++ b/manifests/packages.pp @@ -45,7 +45,26 @@ class tripleo::packages ( if $enable_upgrade { Package <| |> { ensure => 'latest' } + + case $::osfamily { + 'RedHat': { + $pkg_upgrade_cmd = 'yum -y update' + } + default: { + warning('Please specify a package upgrade command for distribution.') + } + } + + exec { 'package-upgrade': + command => $pkg_upgrade_cmd, + path => '/usr/bin', + } + # A resource chain to ensure the upgrade ordering we want: + # 1) upgrade puppet managed packages (will trigger puppet dependencies) + # 2) then upgrade all packages via exec + # 3) then restart services + Package <| |> -> Exec['package-upgrade'] -> Service <| |> + } } - -- cgit 1.2.3-korg