summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/dselect.pp9
-rw-r--r--manifests/init.pp15
-rw-r--r--manifests/params.pp8
-rw-r--r--manifests/preferences_snippet.pp3
-rw-r--r--manifests/sources_list.pp8
-rw-r--r--manifests/unattended_upgrades.pp24
6 files changed, 37 insertions, 30 deletions
diff --git a/manifests/dselect.pp b/manifests/dselect.pp
index 6feeb9f..2b99a43 100644
--- a/manifests/dselect.pp
+++ b/manifests/dselect.pp
@@ -1,9 +1,10 @@
+# manage dselect, like
+# suppressing the annoying help texts
class apt::dselect {
- # suppress annoying help texts of dselect
- line { 'dselect_expert':
- file => '/etc/dpkg/dselect.cfg',
- line => 'expert',
+ file_line { 'dselect_expert':
+ path => '/etc/dpkg/dselect.cfg',
+ line => 'expert',
}
package { 'dselect': ensure => installed }
diff --git a/manifests/init.pp b/manifests/init.pp
index 21e546f..68856cc 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -5,19 +5,21 @@
class apt(
$codename = $apt::params::codename,
+ $use_lts = $apt::params::use_lts,
$use_volatile = $apt::params::use_volatile,
$include_src = $apt::params::include_src,
$use_next_release = $apt::params::use_next_release,
$debian_url = $apt::params::debian_url,
$security_url = $apt::params::security_url,
$backports_url = $apt::params::backports_url,
+ $lts_url = $apt::params::lts_url,
$volatile_url = $apt::params::volatile_url,
$ubuntu_url = $apt::params::ubuntu_url,
$repos = $apt::params::repos,
$custom_preferences = $apt::params::custom_preferences,
+ $custom_sources_list = '',
$disable_update = $apt::params::disable_update,
- $custom_key_dir = $apt::params::custom_key_dir,
- $custom_sources_list = undef
+ $custom_key_dir = $apt::params::custom_key_dir
) inherits apt::params {
case $::operatingsystem {
'debian': {
@@ -54,10 +56,9 @@ class apt(
$next_codename = debian_nextcodename($codename)
$next_release = debian_nextrelease($release)
- if $custom_sources_list == undef {
- $sources_content = template( "apt/${::operatingsystem}/sources.list.erb")
- } else {
- $sources_content = $custom_sources_list
+ $sources_content = $custom_sources_list ? {
+ '' => template( "apt/${::operatingsystem}/sources.list.erb"),
+ default => $custom_sources_list
}
file {
# include main, security and backports
@@ -113,8 +114,8 @@ class apt(
package { 'debian-backports-keyring': ensure => absent }
include common::moduledir
+ common::module_dir { 'apt': }
$apt_base_dir = "${common::moduledir::module_dir_path}/apt"
- modules_dir { 'apt': }
if $custom_key_dir {
file { "${apt_base_dir}/keys.d":
diff --git a/manifests/params.pp b/manifests/params.pp
index 12273ac..f977c27 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -1,14 +1,16 @@
class apt::params () {
$codename = $::lsbdistcodename
+ $use_lts = false
$use_volatile = false
$include_src = false
$use_next_release = false
- $debian_url = 'http://http.debian.net/debian/'
+ $debian_url = 'http://httpredir.debian.org/debian/'
$security_url = 'http://security.debian.org/'
$backports_url = $::lsbdistcodename ? {
- 'wheezy' => $debian_url,
- default => 'http://backports.debian.org/debian-backports/',
+ 'squeeze' => 'http://backports.debian.org/debian-backports/',
+ default => $debian_url
}
+ $lts_url = $debian_url
$volatile_url = 'http://volatile.debian.org/debian-volatile/'
$ubuntu_url = 'http://archive.ubuntu.com/ubuntu'
$repos = 'auto'
diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp
index cbc83d2..0c7b7bb 100644
--- a/manifests/preferences_snippet.pp
+++ b/manifests/preferences_snippet.pp
@@ -34,9 +34,6 @@ define apt::preferences_snippet (
owner => root, group => 0, mode => '0644';
}
- # This should really work in the same manner as sources_list and apt_conf
- # snippets, but since the preferences.d directory cannot be used in Debian
- # lenny, we can't generalize without going into ugly special-casing.
case $source {
'': {
case $release {
diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp
index 3367f83..aefad2d 100644
--- a/manifests/sources_list.pp
+++ b/manifests/sources_list.pp
@@ -15,22 +15,24 @@ define apt::sources_list (
include apt::dot_d_directories
+ $realname = regsubst($name, '\.list$', '')
+
# One would expect the 'file' resource on sources.list.d to trigger an
# apt-get update when files are added or modified in the directory, but it
# apparently doesn't.
- file { "/etc/apt/sources.list.d/${name}":
+ file { "/etc/apt/sources.list.d/${realname}.list":
ensure => $ensure,
owner => root, group => 0, mode => '0644',
notify => Exec['refresh_apt'],
}
if $source {
- File["/etc/apt/sources.list.d/${name}"] {
+ File["/etc/apt/sources.list.d/${realname}.list"] {
source => $source,
}
}
else {
- File["/etc/apt/sources.list.d/${name}"] {
+ File["/etc/apt/sources.list.d/${realname}.list"] {
content => $content,
}
}
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'],
}
}