add $custom_sources_list to override sources.list contents

This commit is contained in:
root 2007-09-14 08:16:33 +02:00 committed by David Schmitt
parent 5e254ad298
commit bb6bdb7701
2 changed files with 23 additions and 5 deletions

2
README
View file

@ -35,6 +35,8 @@ $lsbdistcodename: Contains the Codename ("etch", "lenny", ...) of the client's
release. While the values comes from lsb-release by default, this value release. While the values comes from lsb-release by default, this value
can be set manually too, to enable forced upgrades e.g. can be set manually too, to enable forced upgrades e.g.
$custom_sources_list: If non-empty, the contents of this variable are used as
new sources.list for the node.
Classes Classes
======= =======

View file

@ -21,12 +21,28 @@ class apt {
# a few templates need lsbdistcodename # a few templates need lsbdistcodename
include assert_lsbdistcodename include assert_lsbdistcodename
case $custom_sources_list {
'': {
include default_sources_list
}
default: {
config_file { "/etc/apt/sources.list":
content => $custom_sources_list
}
}
}
class default_sources_list {
config_file {
# include main, security and backports
# additional sources could be included via an array
"/etc/apt/sources.list":
content => template("apt/sources.list.erb"),
require => Exec[assert_lsbdistcodename];
}
}
config_file { config_file {
# include main, security and backports
# additional sources could be included via an array
"/etc/apt/sources.list":
content => template("apt/sources.list.erb"),
require => Exec[assert_lsbdistcodename];
# this just pins unstable and testing to very low values # this just pins unstable and testing to very low values
"/etc/apt/preferences": "/etc/apt/preferences":
content => template("apt/preferences.erb"), content => template("apt/preferences.erb"),