From 76ecb0fa745807c6a4f716264dbc287e926854e9 Mon Sep 17 00:00:00 2001 From: "Robert A. Vincent II (Bob-Vee)" 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..90c5f1289d 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -56,13 +56,20 @@ } else { $_refresh = true } + $apt_update_successful = @("BASH") + for try in {${apt::_update['tries']}..1}; do + timeout ${apt::_update['timeout'] ${apt::provider} update && exit 0 + [[ $try -eq 1 ]] && exit $? + sleep 1 + done + - BASH 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, } }