- if $::apt::always_apt_update == false {
- #if always_apt_update is true there's no point in parsing this logic.
-
- case $apt::apt_update_frequency {
- 'always': {
- $_kick_apt = true
- }
- 'daily': {
- #compare current date with the apt_update_last_success fact to determine
- #if we should kick apt_update.
- $daily_threshold = (strftime('%s') - 86400)
- if $::apt_update_last_success {
- if $::apt_update_last_success < $daily_threshold {
- $_kick_apt = true
- }
- } else {
- #if apt-get update has not successfully run, we should kick apt_update
+ case $::apt::_update['frequency'] {
+ 'always': {
+ $_kick_apt = true
+ }
+ 'daily': {
+ #compare current date with the apt_update_last_success fact to determine
+ #if we should kick apt_update.
+ $daily_threshold = (Integer(Timestamp().strftime('%s')) - 86400)
+ if $::apt_update_last_success {
+ if $::apt_update_last_success + 0 < $daily_threshold {