From bf97014f140659e05319e1ea11d7f745a0347842 Mon Sep 17 00:00:00 2001 From: Robert August Vincent II Date: Wed, 7 Dec 2022 16:36:56 -0500 Subject: [PATCH] MODULES-10763 Do not report apt-get update as a change --- manifests/update.pp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/manifests/update.pp b/manifests/update.pp index ef37f52db0..6c448f4d85 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -56,13 +56,25 @@ } else { $_refresh = true } + $apt_update_successful = @("ASH"/$) + try=1 + while [ $try -le ${apt::_update['tries']} ]; do + timeout ${apt::_update['timeout']} ${apt::provider} update && exit 0 + [ \$try -eq 1 ] && exit \$? + sleep 1 + try=$(( try + 1 )) + done + - ASH exec { 'apt_update': - command => "${apt::provider} update", + command => "echo ${apt::provider} update FAILED", loglevel => $apt::_update['loglevel'], logoutput => 'on_failure', + path => '/bin:/usr/bin', + provider => shell, refreshonly => $_refresh, + returns => [-1], # This ensures a run-time failure. timeout => $apt::_update['timeout'], tries => $apt::_update['tries'], - try_sleep => 1, + unless => $apt_update_successful, } }