File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 56
56
} else {
57
57
$_refresh = true
58
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
59
68
exec { 'apt_update' :
60
- command => " ${apt::provider} update" ,
69
+ command => " echo ${apt::provider} update FAILED " ,
61
70
loglevel => $apt::_update [' loglevel' ],
62
71
logoutput => ' on_failure' ,
72
+ path => ' /bin:/usr/bin' ,
73
+ provider => shell,
63
74
refreshonly => $_refresh,
75
+ returns => [-1], # This ensures a run-time failure.
64
76
timeout => $apt::_update [' timeout' ],
65
77
tries => $apt::_update [' tries' ],
66
- try_sleep => 1 ,
78
+ unless => $apt_update_successful ,
67
79
}
68
80
}
You can’t perform that action at this time.
0 commit comments