]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
migrate concatenated_file to the concat module
authormh <mh@immerda.ch>
Fri, 5 Aug 2011 08:57:13 +0000 (10:57 +0200)
committermh <mh@immerda.ch>
Fri, 5 Aug 2011 08:57:13 +0000 (10:57 +0200)
README
manifests/preferences.pp
manifests/preferences_snippet.pp

diff --git a/README b/README
index 31c715afa5dd2edbf28939d641b012bc37cb7896..ba287d97d91b0b01c34b26806357f64551438372 100644 (file)
--- a/README
+++ b/README
@@ -19,6 +19,7 @@ This module needs:
 
 - lsb-release installed
 - the common module: git://labs.riseup.net/shared-common
+- the concat module: https://github.com/ripienaar/puppet-concat
 
 By default, on normal hosts, this module sets the configuration option
 DSelect::Clean to 'auto'. On virtual servers, the value is set by default to
index 71ef0a61fa9ba8652fa82e0fd6ea71b8442ffe16..f188149c7e9bbbc7fd2f34eb142bbd4a69638cfb 100644 (file)
@@ -1,9 +1,6 @@
 class apt::preferences {
 
-  include common::moduledir
-  $apt_preferences_dir = "${common::moduledir::module_dir_path}/apt/preferences"
-  module_dir{'apt/preferences': }
-  file { "${apt_preferences_dir}_header":
+  concat::fragment{"apt_preferences_header":
     content => $custom_preferences ? {
       '' => $operatingsystem ? {
         'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
@@ -11,16 +8,15 @@ class apt::preferences {
       },
       default => $custom_preferences
     },
+    order => 00,
+    target => '/etc/apt/preferences',
   }
 
-  concatenated_file { '/etc/apt/preferences':
-    dir => $apt_preferences_dir,
-    header => "${apt_preferences_dir}_header",
-    # use Concatenated_file[apt_config] to reference a completed configuration
-    # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML
+  concat{'/etc/apt/preferences':
     alias => apt_config,
     # only update together
-    require => File["/etc/apt/sources.list"];
+    require => File["/etc/apt/sources.list"],
+    owner => root, group => 0, mode => 0644;
   }
 
 }
index 4b8e575e5fc38912792f1b3e1e9aac0ffdc95f94..bcc12de979999b55e6c71bffb0682db92d275ab5 100644 (file)
@@ -11,11 +11,9 @@ define apt::preferences_snippet(
 
   include apt::preferences
 
-  file { "${apt::preferences::apt_preferences_dir}/${name}":
+  concat::fragment{"apt_preference_${name}":
     ensure => $ensure,
-    #TODO this template is somewhat limited
-    notify => Exec["concat_${apt::preferences::apt_preferences_dir}"],
-    owner => root, group => 0, mode => 0600;
+    target => '/etc/apt/preferences',
   }
 
   # This should really work in the same manner as sources_list and apt_conf
@@ -23,12 +21,12 @@ define apt::preferences_snippet(
   # lenny, we can't generalize without going into ugly special-casing.
   case $source {
     '': {
-      File["${apt::preferences::apt_preferences_dir}/${name}"] {
+      Concat::Fragment[$name]{
         content => template("apt/preferences_snippet.erb")
       }
     }
     default: {
-      File["${apt::preferences::apt_preferences_dir}/${name}"] {
+      Concat::Fragment[$name]{
         source => $source
       }
     }