2 #TODO: to catch if $::apt_update_last_success has the value of -1 here. If we
3 #opt to do this, a info/warn would likely be all you'd need likely to happen
4 #on the first run, but if it's not run in awhile something is likely borked
5 #with apt and we'd want to know about it.
7 case $::apt::_update['frequency'] {
12 #compare current date with the apt_update_last_success fact to determine
13 #if we should kick apt_update.
14 $daily_threshold = (strftime('%s') - 86400)
15 if $::apt_update_last_success {
16 if $::apt_update_last_success + 0 < $daily_threshold {
22 #if apt-get update has not successfully run, we should kick apt_update
27 #compare current date with the apt_update_last_success fact to determine
28 #if we should kick apt_update.
29 $weekly_threshold = (strftime('%s') - 604800)
30 if $::apt_update_last_success {
31 if ( $::apt_update_last_success + 0 < $weekly_threshold ) {
37 #if apt-get update has not successfully run, we should kick apt_update
42 #catches 'reluctantly', and any other value (which should not occur).
54 command => "${::apt::provider} update",
55 logoutput => 'on_failure',
56 refreshonly => $_refresh,
57 timeout => $::apt::_update['timeout'],
58 tries => $::apt::_update['tries'],