From 8229505ecb20da114d76a8704f4566483c965f83 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Thu, 20 Sep 2012 03:55:58 -0400 Subject: 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 --- manifests/preferences_snippet.pp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'manifests/preferences_snippet.pp') diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index 6a8e6bc..1aafe57 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -23,11 +23,9 @@ define apt::preferences_snippet( fail("apt::preferences_snippet requires either a 'pin' or 'release' argument, not both") } - include apt::preferences - - concat::fragment{"apt_preference_${name}": + file { "/etc/apt/preferences.d/${name}": ensure => $ensure, - target => '/etc/apt/preferences', + owner => root, group => 0, mode => 0644; } # This should really work in the same manner as sources_list and apt_conf @@ -37,19 +35,19 @@ define apt::preferences_snippet( '': { case $release { '': { - Concat::Fragment["apt_preference_${name}"]{ + File["/etc/apt/preferences.d/${name}"]{ content => template("apt/preferences_snippet.erb") } } default: { - Concat::Fragment["apt_preference_${name}"]{ + File["/etc/apt/preferences.d/${name}"]{ content => template("apt/preferences_snippet_release.erb") } } } } default: { - Concat::Fragment["apt_preference_${name}"]{ + File["/etc/apt/preferences.d/${name}"]{ source => $source } } -- cgit v1.2.3