diff options
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | manifests/init.pp | 26 |
2 files changed, 23 insertions, 5 deletions
@@ -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 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 ======= diff --git a/manifests/init.pp b/manifests/init.pp index 6f34cd1..161a5da 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,12 +21,28 @@ class apt { # a few templates need 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 { - # 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 "/etc/apt/preferences": content => template("apt/preferences.erb"), |