diff --git a/manifests/init.pp b/manifests/init.pp index b0d85147..1bfe7657 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -198,6 +198,11 @@ notify => Exec[$fact_exec], } + $autoremove_ensure = $apt_autoremove ? { + true => 'present', + default => 'absent' + } + $patch_window_ensure = ($ensure == 'present' and $patch_window ) ? { true => 'file', default => 'absent' @@ -325,7 +330,7 @@ if $facts['os']['family'] == 'Debian' and $apt_autoremove == true { cron { 'Run apt autoremove on reboot': - ensure => $ensure, + ensure => $autoremove_ensure, command => 'apt-get -y autoremove', user => $patch_cron_user, special => 'reboot',