diff options
Diffstat (limited to 'manifests/unattended_upgrades.pp')
-rw-r--r-- | manifests/unattended_upgrades.pp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index 6e0e44a..9f74bbd 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -1,17 +1,21 @@ -class apt::unattended_upgrades { +class apt::unattended_upgrades ( + $config_content = undef, + $mailonlyonerror = true, + $mail_recipient = 'root', + $blacklisted_packages = [], +) { package { 'unattended-upgrades': - ensure => present, - require => Exec['refresh_apt'] + ensure => present + } + + $file_content = $config_content ? { + undef => template('apt/50unattended-upgrades.erb'), + default => $config_content } apt_conf { '50unattended-upgrades': - source => [ - "puppet:///modules/site_apt/${::lsbdistid}/50unattended-upgrades.${::lsbdistcodename}", - "puppet:///modules/site_apt/${::lsbdistid}/50unattended-upgrades", - "puppet:///modules/apt/${::lsbdistid}/50unattended-upgrades.${::lsbdistcodename}", - "puppet:///modules/apt/${::lsbdistid}/50unattended-upgrades" ], - require => Package['unattended-upgrades'], - refresh_apt => false + content => $file_content, + require => Package['unattended-upgrades'], } } |