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