aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-10-17 01:35:37 +0200
committerintrigeri <intrigeri@boum.org>2010-10-17 01:35:37 +0200
commite2f80db7b76171e5945127e2fd42fb35043990fb (patch)
treeeae4de6311f33d6c1a813d38997fae6acbd50ada
parent7613ddde674f4688c99bc26502d12007b933f061 (diff)
downloadpuppet-apt-e2f80db7b76171e5945127e2fd42fb35043990fb.tar.gz
puppet-apt-e2f80db7b76171e5945127e2fd42fb35043990fb.tar.bz2
Bring in a bit of Ubuntu support from Nadir.
-rw-r--r--README2
-rw-r--r--manifests/default_preferences.pp32
-rw-r--r--manifests/default_sources_list.pp2
-rw-r--r--templates/Debian/preferences_lenny.erb (renamed from templates/preferences_lenny.erb)0
-rw-r--r--templates/Debian/preferences_sid.erb (renamed from templates/preferences_sid.erb)0
-rw-r--r--templates/Debian/preferences_squeeze.erb (renamed from templates/preferences_squeeze.erb)0
-rw-r--r--templates/Debian/sources.list.erb (renamed from templates/sources.list.erb)0
-rw-r--r--templates/Ubuntu/sources.list.erb22
8 files changed, 44 insertions, 14 deletions
diff --git a/README b/README
index d1249a0..8dafe2f 100644
--- 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.
diff --git a/manifests/default_preferences.pp b/manifests/default_preferences.pp
index 521d2f2..605ba78 100644
--- a/manifests/default_preferences.pp
+++ b/manifests/default_preferences.pp
@@ -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')
+ }
}
}
diff --git a/manifests/default_sources_list.pp b/manifests/default_sources_list.pp
index 34234e3..0e78c02 100644
--- a/manifests/default_sources_list.pp
+++ b/manifests/default_sources_list.pp
@@ -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/preferences_lenny.erb b/templates/Debian/preferences_lenny.erb
index 3de7959..3de7959 100644
--- a/templates/preferences_lenny.erb
+++ b/templates/Debian/preferences_lenny.erb
diff --git a/templates/preferences_sid.erb b/templates/Debian/preferences_sid.erb
index 3d8a45f..3d8a45f 100644
--- a/templates/preferences_sid.erb
+++ b/templates/Debian/preferences_sid.erb
diff --git a/templates/preferences_squeeze.erb b/templates/Debian/preferences_squeeze.erb
index f21562d..f21562d 100644
--- a/templates/preferences_squeeze.erb
+++ b/templates/Debian/preferences_squeeze.erb
diff --git a/templates/sources.list.erb b/templates/Debian/sources.list.erb
index 67da85d..67da85d 100644
--- a/templates/sources.list.erb
+++ b/templates/Debian/sources.list.erb
diff --git a/templates/Ubuntu/sources.list.erb b/templates/Ubuntu/sources.list.erb
new file mode 100644
index 0000000..44f3024
--- /dev/null
+++ b/templates/Ubuntu/sources.list.erb
@@ -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