]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Migrate config file to line-editing.
authorintrigeri <intrigeri@boum.org>
Sun, 17 Oct 2010 00:21:08 +0000 (02:21 +0200)
committerintrigeri <intrigeri@boum.org>
Sun, 17 Oct 2010 00:30:28 +0000 (02:30 +0200)
This allows other modules to add lines there too.

README
manifests/init.pp

diff --git a/README b/README
index 8dafe2f7df2da4d709254d4e1f69760feecbdafb..b786b9d53f99a3a826c3b13e795c815c855439fa 100644 (file)
--- a/README
+++ b/README
@@ -17,7 +17,10 @@ accidental upgrades.
 
 Ubuntu support is lagging behind but not absent either.
 
-This module needs lsb-release installed.
+This module needs:
+
+- lsb-release installed
+- the common module: git://labs.riseup.net/shared-common
 
 
 Variables
index a95ff17eeb383f146808438a545310232973448e..619dd0df8ecad1a0668352df2cec9f719522644e 100644 (file)
@@ -103,17 +103,25 @@ class apt {
     }
   }
 
-  config_file {
-    # little default settings which keep the system sane
-    "/etc/apt/apt.conf.d/99from_puppet":
-      content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
-      before => Config_file[apt_config];
+  config_file { '/etc/apt/apt.conf.d/99from_puppet': }
+  # little default settings which keep the system sane
+  line { 'apt-get-show-upgraded':
+    file    => "/etc/apt/apt.conf.d/99from_puppet",
+    line    => "APT::Get::Show-Upgraded true;",
+    before  => Config_file[apt_config],
+    require => Config_file['/etc/apt/apt.conf.d/99from_puppet'],
+  }
+  line { 'dselect-clean':
+    file    => "/etc/apt/apt.conf.d/99from_puppet",
+    line    => "DSelect::Clean ${real_apt_clean};",
+    before  => Config_file[apt_config],
+    require => Config_file['/etc/apt/apt.conf.d/99from_puppet'],
   }
   # backward compatibility: upgrade from previous versions of this module.
   file {
     "/etc/apt/apt.conf.d/from_puppet":
       ensure  => 'absent',
-      require => Config_File['/etc/apt/apt.conf.d/99from_puppet'],
+      require => [ Line['apt-get-show-upgraded'], Line['dselect-clean'] ],
   }
 
   if $apt_unattended_upgrades {
@@ -125,10 +133,6 @@ class apt {
   modules_dir { apt: }
   # watch apt.conf.d
   file { "/etc/apt/apt.conf.d": ensure => directory, checksum => mtime; }
-  file { '/etc/apt/apt.conf.d/99-puppet':
-      ensure => 'file',
-      owner => 'root', group => '0', mode => '0644',
-  }
 
   exec {
     # "&& sleep 1" is workaround for older(?) clients