summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2008-09-28 18:10:28 -0400
committerMicah Anderson <micah@riseup.net>2008-09-28 18:10:28 -0400
commit82e7e762b9d8a77cbdbdb4cacd777073c044fe92 (patch)
tree7ce91c26356d54de926f3fbb81c3f8798e50a109 /manifests
parente0a6bf1b7a480cead5776962c9524d157aa96f1b (diff)
abstract the apt preferences so that custom preferences can be set,
while maintaining a sane default preferences set can be set. This is done in the same manner that the custom/default sources_list are handled
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp42
1 files changed, 28 insertions, 14 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index f85a535..c050703 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -41,20 +41,34 @@ class apt {
}
}
- config_file {
- # this just pins unstable and testing to very low values
- "/etc/apt/preferences":
- content => template("apt/preferences.erb"),
- # use File[apt_config] to reference a completed configuration
- # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML
- alias => apt_config,
- # only update together
- require => File["/etc/apt/sources.list"];
- # little default settings which keep the system sane
- "/etc/apt/apt.conf.d/from_puppet":
- content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
- before => File[apt_config];
- }
+ case $custom_preferences {
+ '': {
+ include default_preferences
+ }
+ default: {
+ config_file { "/etc/apt/preferences":
+ content => $custom_preferences
+ alias => apt_config,
+ require => File["/etc/apt/sources.list"];
+ }
+ }
+ }
+ class default_preferences {
+ config_file {
+ # this just pins unstable and testing to very low values
+ "/etc/apt/preferences":
+ content => template("apt/preferences.erb"),
+ # use File[apt_config] to reference a completed configuration
+ # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML
+ alias => apt_config,
+ # only update together
+ require => File["/etc/apt/sources.list"];
+ # little default settings which keep the system sane
+ "/etc/apt/apt.conf.d/from_puppet":
+ content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
+ before => File[apt_config];
+ }
+ }
$apt_base_dir = "/var/lib/puppet/modules/apt"
modules_dir { apt: }