5 #TODO: to catch if $::apt_update_last_success has the value of -1 here. If we
6 #opt to do this, a info/warn would likely be all you'd need likely to happen
7 #on the first run, but if it's not run in awhile something is likely borked
8 #with apt and we'd want to know about it.
10 case $::apt::_update['frequency'] {
15 #compare current date with the apt_update_last_success fact to determine
16 #if we should kick apt_update.
17 $daily_threshold = (strftime('%s') - 86400)
18 if $::apt_update_last_success {
19 if $::apt_update_last_success + 0 < $daily_threshold {
25 #if apt-get update has not successfully run, we should kick apt_update
30 #compare current date with the apt_update_last_success fact to determine
31 #if we should kick apt_update.
32 $weekly_threshold = (strftime('%s') - 604800)
33 if $::apt_update_last_success {
34 if ( $::apt_update_last_success + 0 < $weekly_threshold ) {
40 #if apt-get update has not successfully run, we should kick apt_update
45 #catches 'reluctantly', and any other value (which should not occur).
57 command => "${::apt::provider} update",
58 loglevel => $::apt::_update['loglevel'],
59 logoutput => 'on_failure',
60 refreshonly => $_refresh,
61 timeout => $::apt::_update['timeout'],
62 tries => $::apt::_update['tries'],