From 770f8fb5dafa442bc018fa95fcab2fb60d817020 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sat, 3 Oct 2015 01:13:50 -0400 Subject: make backports_url follow debian_url by default backports_url was already set to the same value than debian_url by default, but it was set to the default value of debian_url. this meant that when giving a url to the debian_url parameter to the apt class, the backports_url would not follow and would still be using the default value for debian_url. with this change, when backports_url is not specified, but debian_url is, then both of them take on the value given to the debian_url. of course if backports_url is also given a value, then it keeps the value given by the user. --- manifests/init.pp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index 4c44af2..9c186cc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -35,6 +35,11 @@ class apt( } } + $real_backports_url = $backports_url ? { + false => $debian_url, + default => $backports_url, + } + package { 'apt': ensure => installed, require => undef, @@ -99,12 +104,12 @@ class apt( if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) { apt::sources_list { 'backports': - content => "deb $backports_url ${::debian_codename}-backports ${apt::real_repos}", + content => "deb ${real_backports_url} ${::debian_codename}-backports ${apt::repos}", } if $include_src { apt::sources_list { 'backports-src': - content => "deb-src $backports_url ${::debian_codename}-backports ${apt::real_repos}", + content => "deb-src ${real_backports_url} ${::debian_codename}-backports ${apt::repos}", } } } -- cgit v1.2.3