aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-10-17 02:21:08 +0200
committerintrigeri <intrigeri@boum.org>2010-10-17 02:30:28 +0200
commit7a0dc9a37a29f4cbdd44c660478932a57e7511db (patch)
treeccbe00c4a680261fb8fcfb1cc3fdc02f51755f18
parent8ce3c34be56770e7030108bbd9d4d0cdbd7e5e2f (diff)
downloadpuppet-apt-7a0dc9a37a29f4cbdd44c660478932a57e7511db.tar.gz
puppet-apt-7a0dc9a37a29f4cbdd44c660478932a57e7511db.tar.bz2
Migrate config file to line-editing.
This allows other modules to add lines there too.
-rw-r--r--README5
-rw-r--r--manifests/init.pp24
2 files changed, 18 insertions, 11 deletions
diff --git a/README b/README
index 8dafe2f..b786b9d 100644
--- 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
diff --git a/manifests/init.pp b/manifests/init.pp
index a95ff17..619dd0d 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -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