]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Bring in a bit of Ubuntu support from Nadir.
authorintrigeri <intrigeri@boum.org>
Sat, 16 Oct 2010 23:35:37 +0000 (01:35 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 16 Oct 2010 23:35:37 +0000 (01:35 +0200)
README
manifests/default_preferences.pp
manifests/default_sources_list.pp
templates/Debian/preferences_lenny.erb [moved from templates/preferences_lenny.erb with 100% similarity]
templates/Debian/preferences_sid.erb [moved from templates/preferences_sid.erb with 100% similarity]
templates/Debian/preferences_squeeze.erb [moved from templates/preferences_squeeze.erb with 100% similarity]
templates/Debian/sources.list.erb [moved from templates/sources.list.erb with 100% similarity]
templates/Ubuntu/sources.list.erb [new file with mode: 0644]

diff --git a/README b/README
index d1249a0b2a0317653533843b9fab506e86730931..8dafe2f7df2da4d709254d4e1f69760feecbdafb 100644 (file)
--- a/README
+++ b/README
@@ -15,6 +15,8 @@ sources.list and apt_preferences are managed. More recent Debian
 releases are pinned to very low values by default to prevent
 accidental upgrades.
 
+Ubuntu support is lagging behind but not absent either.
+
 This module needs lsb-release installed.
 
 
index 521d2f234de15e9aeee7fc37241114651d447de0..605ba78465570be860041d3ff4e7d98ba77811f2 100644 (file)
@@ -1,16 +1,22 @@
 class apt::default_preferences {
-  config_file {
-    # this just pins unstable and testing to very low values
-    "/etc/apt/preferences":
-      content => template("apt/preferences_${codename}.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 => Config_file[apt_config];
+  case $operatingsystem {
+    'debian': {
+      config_file {
+        "/etc/apt/preferences":
+          content => template("apt/${operatingsystem}/preferences_${codename}.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 => Config_file[apt_config];
+      }
+    }
+    'ubuntu': {
+      notice('There is no support for default Ubuntu APT preferences')
+    }
   }
 }
index 34234e3668509269dbb9186c5456d4f7c2336968..0e78c0265c1f2f6e2ca2711d82ad5645e96ec4f3 100644 (file)
@@ -3,7 +3,7 @@ class apt::default_sources_list {
     # include main, security and backports
     # additional sources could be included via an array
     "/etc/apt/sources.list":
-      content => template("apt/sources.list.erb"),
+      content => template("apt/${operatingsystem}/sources.list.erb"),
   }
 }
 
diff --git a/templates/Ubuntu/sources.list.erb b/templates/Ubuntu/sources.list.erb
new file mode 100644 (file)
index 0000000..44f3024
--- /dev/null
@@ -0,0 +1,22 @@
+# This file is brought to you by puppet
+
+# basic <%= lsbdistcodename %>
+deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %> main restricted universe multiverse
+<% if include_src then -%>
+deb-src http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %> main restricted universe multiverse
+<% end -%>
+
+# updates
+deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-updates main restricted universe multiverse
+<% if include_src then -%>
+deb-src http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-updates main restricted universe multiverse
+<% end -%>
+
+# security suppport
+deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-security main restricted universe multiverse
+<% if include_src then -%>
+deb-src http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-security main restricted universe multiverse
+<% end -%>
+
+# backports
+deb http://archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-backports main universe multiverse restricted