diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 86 |
1 files changed, 78 insertions, 8 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 1af6e1f..87668fd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,6 +3,7 @@ # Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at> # See LICENSE for the full license granted to you. + class apt { # See README @@ -15,6 +16,16 @@ class apt { '' => 'false', default => $backports_enabled, } + + $apt_deb_src_enabled = $apt_deb_src_enabled ? { + 'true' => 'true', + default => $apt_deb_src_enabled, + } + + $apt_volatile_enabled = $apt_volatile_enabled ? { + 'true' => 'true', + default => $apt_volatile_enabled, + } package { apt: ensure => installed } @@ -38,12 +49,23 @@ class apt { # include main, security and backports # additional sources could be included via an array "/etc/apt/sources.list": - content => template("apt/sources.list.erb"), + content => template("apt/${operatingsystem}/sources.list.erb"), require => Exec[assert_lsbdistcodename]; } } - - case $custom_preferences { + + define custom_sources_template ($sources_file = "") { + file { "/etc/apt/sources.list.d/$sources_file": + content => template($name), + require => Exec[assert_lsbdistcodename]; + } + exec { "/usr/bin/apt-get update": + subscribe => File["/etc/apt/sources.list.d/$sources_file"], + refreshonly => true, + } + } + + case $custom_preferences { '': { include default_preferences } @@ -84,11 +106,6 @@ class apt { subscribe => [ File["/etc/apt/sources.list"], File["/etc/apt/preferences"], File["/etc/apt/apt.conf.d"], File[apt_config] ]; - "/usr/bin/apt-get update && /usr/bin/apt-get autoclean #hourly": - require => [ File["/etc/apt/sources.list"], - File["/etc/apt/preferences"], File[apt_config] ], - # Another Semaphor for all packages to reference - alias => apt_updated; } ## This package should really always be current @@ -96,12 +113,25 @@ class apt { ensure => latest, } +<<<<<<< HEAD + ## This package should really always be current + package { "debian-archive-keyring": + ensure => latest, + } + +======= +>>>>>>> riseup/master case $backports_enabled { 'true': { config_file { # backports +<<<<<<< HEAD + "/etc/apt/sources.list.d/${operatingsystem}-backports.list": + content => template("apt/${operatingsystem}/sources.list.backports.erb"), +======= "/etc/apt/sources.list.d/debian-backports.list": content => template("apt/sources.list.backports.erb"), +>>>>>>> riseup/master require => Exec[assert_lsbdistcodename]; } @@ -150,7 +180,31 @@ class apt { default: { } } +<<<<<<< HEAD + case $apt_deb_src_enabled { + 'true': { + config_file { + "/etc/apt/sources.list.d/${operatingsystem}-sources.list": + content => template("apt/${operatingsystem}/sources.list.deb-src.erb"), + require => Exec[assert_lsbdistcodename]; + } + } + default: {} + } + + case $apt_volatile_enabled { + 'true': { + config_file { + "/etc/apt/sources.list.d/${operatingsystem}-volatile.list": + content => template("apt/${operatingsystem}/sources.list.volatile.erb"), + require => Exec[assert_lsbdistcodename]; + } + } + default: {} + } +======= +>>>>>>> riseup/master case $custom_key_dir { '': { @@ -226,3 +280,19 @@ class dselect { package { dselect: ensure => installed } } + + +class apt::unattended_upgrades inherits apt { + package { unattended-upgrades : ensure => latest; } + file { "/etc/apt/apt.conf.d/50unattended-upgrades": + source => "puppet://$server/modules/apt/50unattended-upgrades" } +} + +class apt::cron inherits apt { + file {'/etc/cron.d/apt.cron': + source => undef, + content => "# by puppet\n3 * * * * root /usr/bin/apt-get update && /usr/bin/apt-get autoclean\n", + notify => service["crond"]; + } +} + |