aboutsummaryrefslogtreecommitdiff
path: root/manifests/preferences.pp
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2012-09-20 03:55:58 -0400
committerGabriel Filion <lelutin@gmail.com>2012-09-20 03:55:58 -0400
commit8229505ecb20da114d76a8704f4566483c965f83 (patch)
tree542fe92e6c4f38323de1429d5c393a0c7bb82152 /manifests/preferences.pp
parent978378623d250a06441650dd969eb01f90891b64 (diff)
downloadpuppet-apt-8229505ecb20da114d76a8704f4566483c965f83.tar.gz
puppet-apt-8229505ecb20da114d76a8704f4566483c965f83.tar.bz2
Make apt::preferences_snippet place files in /etc/apt/preferences.d
Since Debian Squeeze, apt supports a .d directory for preferences (pinning). Simplify management by just placing files inside this .d directory. This removes the need for concat and concat::fragment resources, so removes the dependency on the concat module. It also removes the need for a moduledir that was needed for the concat module magic, so we also get rid of the dependency on the common module. Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Diffstat (limited to 'manifests/preferences.pp')
-rw-r--r--manifests/preferences.pp20
1 files changed, 9 insertions, 11 deletions
diff --git a/manifests/preferences.pp b/manifests/preferences.pp
index f188149..f766819 100644
--- a/manifests/preferences.pp
+++ b/manifests/preferences.pp
@@ -1,20 +1,18 @@
class apt::preferences {
- concat::fragment{"apt_preferences_header":
- content => $custom_preferences ? {
- '' => $operatingsystem ? {
- 'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
- 'ubuntu' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
- },
- default => $custom_preferences
+ $pref_contents = $custom_preferences ? {
+ '' => $operatingsystem ? {
+ 'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
+ 'ubuntu' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
},
- order => 00,
- target => '/etc/apt/preferences',
+ default => $custom_preferences
}
- concat{'/etc/apt/preferences':
- alias => apt_config,
+ file { '/etc/apt/preferences':
+ ensure => present,
+ alias => 'apt_config',
# only update together
+ content => $pref_contents,
require => File["/etc/apt/sources.list"],
owner => root, group => 0, mode => 0644;
}