We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee98a5a commit bf97014Copy full SHA for bf97014
manifests/update.pp
@@ -56,13 +56,25 @@
56
} else {
57
$_refresh = true
58
}
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
68
exec { 'apt_update':
- command => "${apt::provider} update",
69
+ command => "echo ${apt::provider} update FAILED",
70
loglevel => $apt::_update['loglevel'],
71
logoutput => 'on_failure',
72
+ path => '/bin:/usr/bin',
73
+ provider => shell,
74
refreshonly => $_refresh,
75
+ returns => [-1], # This ensures a run-time failure.
76
timeout => $apt::_update['timeout'],
77
tries => $apt::_update['tries'],
- try_sleep => 1,
78
+ unless => $apt_update_successful,
79
80
0 commit comments