From: Morgan Haskel Date: Wed, 25 Mar 2015 15:13:12 +0000 (-0400) Subject: We've got things in params, let's use those! X-Git-Tag: 2.0.0~9^2~4 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=411679c3c012e945f5a24c53c4bff2e9db11f68f;p=puppet-modules%2Fpuppetlabs-apt.git We've got things in params, let's use those! --- diff --git a/examples/backports.pp b/examples/backports.pp index 819d43f..f3ca34c 100644 --- a/examples/backports.pp +++ b/examples/backports.pp @@ -1,54 +1,18 @@ -# If your environment includes mint you'll need something more like this: -# -#$location = $::lsbdistcodename ? { -# 'squeeze' => 'http://backports.debian.org/debian-backports', -# 'wheezy' => 'http://ftp.debian.org/debian/', -# 'debian' => 'http://ftp.debian.org/debian/', #thanks LinuxMint -# default => 'http://us.archive.ubuntu.com/ubuntu', -#} -# -#if ($::lsbdistid == 'LinuxMint' and $::lsbdistcodename == 'debian') or $::lsbdistid == 'Debian' { -# $repos = 'main contrib non-free' -# $key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' -# if $::lsbdistid == 'LinuxMint' { -# $release = 'wheezy' -# } else { -# $release = downcase($::lsbdistrelease) -# } -#} else { -# if $::lsbdistid == 'LinuxMint' { -# $release = $::lsbdistcodename ? { -# 'qiana' => 'trusty', -# 'petra' => 'saucy', -# 'olivia' => 'raring', -# 'nadia' => 'quantal', -# 'maya' => 'precise', -# } -# } else { -# $release = downcase($::lsbdistrelease) -# } -# $repos = 'main universe multiverse restricted' -# $key = '630239CC130E1A7FD81A27B140976EAF437D05B5' -#} +$location = $::apt::distcodename ? { + 'squeeze' => 'http://backports.debian.org/debian-backports', + 'wheezy' => 'http://ftp.debian.org/debian/', + default => 'http://us.archive.ubuntu.com/ubuntu', +} -## Start logic to figure out backports location, repos, key, and release -if $::lsbdistid == 'Debian' { - $repos = 'main contrib non-free' - $key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' - $release = downcase($::lsbdistrelease) - $location = $::lsbdistcodename ? { - 'squeeze' => 'http://backports.debian.org/debian-backports', - 'wheezy' => 'http://ftp.debian.org/debian/', - default => 'http://http.debian.net/debian/', - } +if $::apt::distid == 'debian' { + $repos = 'main contrib non-free' + $key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' + $release = $::apt::distcodename } else { - $release = downcase($::lsbdistrelease) - $repos = 'main universe multiverse restricted' - $key = '630239CC130E1A7FD81A27B140976EAF437D05B5' - $location = 'http://us.archive.ubuntu.com/ubuntu', + $repos = 'main universe multiverse restricted' + $key = '630239CC130E1A7FD81A27B140976EAF437D05B5' + $release = $::apt::distcodename } -## end logic for variables - # set up the actual backports apt::pin { 'backports':