From b626e7f944716b67f7a9f7b7259c52829b53508b 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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/manifests/update.pp b/manifests/update.pp index ef37f52db0..a1cdbbfb2d 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -56,13 +56,20 @@ } else { $_refresh = true } + $apt_update_successful = @("ASH"/$) + for try in $(seq ${apt::_update['tries']} -1 1); do + timeout ${apt::_update['timeout']} ${apt::provider} update && exit 0 + [ \$try -eq 1 ] && exit \$? + sleep 1 + done + - ASH exec { 'apt_update': - command => "${apt::provider} update", + command => "${apt::provider} update FAILED", loglevel => $apt::_update['loglevel'], logoutput => 'on_failure', 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, } }