Skip to content

Commit

Permalink
MODULES-10763 Do not report apt-get update as a change
Browse files Browse the repository at this point in the history
  • Loading branch information
pillarsdotnet committed Dec 19, 2022
1 parent ee98a5a commit bf97014
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions manifests/update.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit bf97014

Please sign in to comment.