summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2015-12-05 20:26:39 +0100
committervarac <varacanero@zeromail.org>2015-12-05 20:26:39 +0100
commitb6cb0285053a0ffd23082d7e63a87108ca0e3fbd (patch)
treea142332e3419df289e9437b6477971276cbc836f /manifests
parentab90d1d0fe9655d367c637e95dff59e4dbe2dd35 (diff)
parentd372562329371c24df889d69ca4d476eda6497e9 (diff)
Merge remote-tracking branch 'shared/master' into leap_master
Diffstat (limited to 'manifests')
-rw-r--r--manifests/apticron.pp2
-rw-r--r--manifests/init.pp32
-rw-r--r--manifests/listchanges.pp2
-rw-r--r--manifests/params.pp10
-rw-r--r--manifests/preferences.pp4
-rw-r--r--manifests/preseeded_package.pp2
-rw-r--r--manifests/unattended_upgrades.pp3
7 files changed, 27 insertions, 28 deletions
diff --git a/manifests/apticron.pp b/manifests/apticron.pp
index 54d7b71..9c94f9c 100644
--- a/manifests/apticron.pp
+++ b/manifests/apticron.pp
@@ -1,6 +1,6 @@
class apt::apticron(
$ensure_version = 'installed',
- $config = "apt/${::operatingsystem}/apticron_${::lsbdistcodename}.erb",
+ $config = "apt/${::operatingsystem}/apticron_${::debian_codename}.erb",
$email = 'root',
$diff_only = '1',
$listchanges_profile = 'apticron',
diff --git a/manifests/init.pp b/manifests/init.pp
index 062be4c..6732ade 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -4,7 +4,6 @@
# See LICENSE for the full license granted to you.
class apt(
- $codename = $apt::params::codename,
$use_lts = $apt::params::use_lts,
$use_volatile = $apt::params::use_volatile,
$use_backports = $apt::params::use_backports,
@@ -42,31 +41,15 @@ class apt(
require => undef,
}
- include lsb
-
- # init $release, $next_release, $next_codename, $release_version
- case $codename {
- 'n/a': {
- fail("Unknown lsbdistcodename reported by facter: '$::lsbdistcodename', please fix this by setting this variable in your manifest.")
- }
- default: {
- $release = debian_release($codename)
- }
- }
- $release_version = debian_release_version($codename)
- $next_codename = debian_nextcodename($codename)
- $next_release = debian_nextrelease($release)
-
$sources_content = $custom_sources_list ? {
'' => template( "apt/${::operatingsystem}/sources.list.erb"),
default => $custom_sources_list
}
file {
- # include main, security and backports
+ # include main and security
# additional sources should be included via the apt::sources_list define
'/etc/apt/sources.list':
content => $sources_content,
- require => Package['lsb'],
notify => Exec['refresh_apt'],
owner => root,
group => 0,
@@ -114,6 +97,19 @@ class apt(
# backports uses the normal archive key now
package { 'debian-backports-keyring': ensure => absent }
+ if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) {
+ apt::sources_list {
+ 'backports':
+ content => "deb $backports_url ${::debian_codename}-backports ${apt::real_repos}",
+ }
+ if $include_src {
+ apt::sources_list {
+ 'backports-src':
+ content => "deb-src $backports_url ${::debian_codename}-backports ${apt::real_repos}",
+ }
+ }
+ }
+
include common::moduledir
common::module_dir { 'apt': }
$apt_base_dir = "${common::moduledir::module_dir_path}/apt"
diff --git a/manifests/listchanges.pp b/manifests/listchanges.pp
index 0c163ae..e64bb1b 100644
--- a/manifests/listchanges.pp
+++ b/manifests/listchanges.pp
@@ -1,6 +1,6 @@
class apt::listchanges(
$ensure_version = 'installed',
- $config = "apt/${::operatingsystem}/listchanges_${::lsbdistcodename}.erb",
+ $config = "apt/${::operatingsystem}/listchanges_${::debian_codename}.erb",
$frontend = 'mail',
$email = 'root',
$confirm = '0',
diff --git a/manifests/params.pp b/manifests/params.pp
index a1c7392..28da13e 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -1,5 +1,4 @@
class apt::params () {
- $codename = $::lsbdistcodename
$use_lts = false
$use_volatile = false
$use_backports = true
@@ -7,13 +6,16 @@ class apt::params () {
$use_next_release = false
$debian_url = 'http://httpredir.debian.org/debian/'
$security_url = 'http://security.debian.org/'
- $backports_url = $::lsbdistcodename ? {
+ $ubuntu_url = 'http://archive.ubuntu.com/ubuntu'
+ $backports_url = $::debian_codename ? {
'squeeze' => 'http://backports.debian.org/debian-backports/',
- default => $debian_url
+ default => $::operatingsystem ? {
+ 'Ubuntu' => $ubuntu_url,
+ default => $debian_url,
+ }
}
$lts_url = $debian_url
$volatile_url = 'http://volatile.debian.org/debian-volatile/'
- $ubuntu_url = 'http://archive.ubuntu.com/ubuntu'
$repos = 'auto'
$custom_preferences = ''
$disable_update = false
diff --git a/manifests/preferences.pp b/manifests/preferences.pp
index 9ed24c1..6982ca0 100644
--- a/manifests/preferences.pp
+++ b/manifests/preferences.pp
@@ -2,8 +2,8 @@ class apt::preferences {
$pref_contents = $apt::custom_preferences ? {
'' => $::operatingsystem ? {
- 'debian' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"),
- 'ubuntu' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"),
+ 'debian' => template("apt/${::operatingsystem}/preferences_${::debian_codename}.erb"),
+ 'ubuntu' => template("apt/${::operatingsystem}/preferences_${::ubuntu_codename}.erb"),
},
default => $apt::custom_preferences
}
diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp
index 9bca8b1..3ef0687 100644
--- a/manifests/preseeded_package.pp
+++ b/manifests/preseeded_package.pp
@@ -4,7 +4,7 @@ define apt::preseeded_package (
) {
$seedfile = "/var/cache/local/preseeding/${name}.seeds"
$real_content = $content ? {
- '' => template ( "site_apt/${::lsbdistcodename}/${name}.seeds" ),
+ '' => template ( "site_apt/${::debian_codename}/${name}.seeds" ),
default => $content
}
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp
index 6cb0518..ffb5fad 100644
--- a/manifests/unattended_upgrades.pp
+++ b/manifests/unattended_upgrades.pp
@@ -1,5 +1,6 @@
class apt::unattended_upgrades (
$config_content = undef,
+ $config_template = 'apt/50unattended-upgrades.erb',
$mailonlyonerror = true,
$mail_recipient = 'root',
$blacklisted_packages = [],
@@ -11,7 +12,7 @@ class apt::unattended_upgrades (
}
$file_content = $config_content ? {
- undef => template('apt/50unattended-upgrades.erb'),
+ undef => template($config_template),
default => $config_content
}