Skip to content

Commit e6263c7

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

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

manifests/update.pp

+11-3
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,21 @@
5656
} else {
5757
$_refresh = true
5858
}
59+
$apt_update_successful = @("ASH"/$)
60+
for try in \$(seq ${apt::_update['tries']} -1 1); do
61+
timeout ${apt::_update['timeout']} ${apt::provider} update && exit 0
62+
[ \$try -eq 1 ] && exit \$?
63+
sleep 1
64+
done
65+
- ASH
5966
exec { 'apt_update':
60-
command => "${apt::provider} update",
67+
command => "echo ${apt::provider} update FAILED",
6168
loglevel => $apt::_update['loglevel'],
6269
logoutput => 'on_failure',
70+
path => '/bin:/usr/bin',
6371
refreshonly => $_refresh,
72+
returns => [-1], # This ensures a run-time failure.
6473
timeout => $apt::_update['timeout'],
65-
tries => $apt::_update['tries'],
66-
try_sleep => 1,
74+
unless => $apt_update_successful,
6775
}
6876
}

0 commit comments

Comments
 (0)