Skip to content

Commit bf97014

Browse files
committed
MODULES-10763 Do not report apt-get update as a change
1 parent ee98a5a commit bf97014

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

manifests/update.pp

+14-2
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,25 @@
5656
} else {
5757
$_refresh = true
5858
}
59+
$apt_update_successful = @("ASH"/$)
60+
try=1
61+
while [ $try -le ${apt::_update['tries']} ]; do
62+
timeout ${apt::_update['timeout']} ${apt::provider} update && exit 0
63+
[ \$try -eq 1 ] && exit \$?
64+
sleep 1
65+
try=$(( try + 1 ))
66+
done
67+
- ASH
5968
exec { 'apt_update':
60-
command => "${apt::provider} update",
69+
command => "echo ${apt::provider} update FAILED",
6170
loglevel => $apt::_update['loglevel'],
6271
logoutput => 'on_failure',
72+
path => '/bin:/usr/bin',
73+
provider => shell,
6374
refreshonly => $_refresh,
75+
returns => [-1], # This ensures a run-time failure.
6476
timeout => $apt::_update['timeout'],
6577
tries => $apt::_update['tries'],
66-
try_sleep => 1,
78+
unless => $apt_update_successful,
6779
}
6880
}

0 commit comments

Comments
 (0)