Separate apt::pin for apt::backports to allow pin by release instead of origin
[puppet-modules/puppetlabs-apt.git] / manifests / backports.pp
index c45bc15682de4933f261a01b3827c5c469f202a9..a3ddb76e0078339b2721498f181866220cf1f6c9 100644 (file)
@@ -39,17 +39,18 @@ class apt::backports(
   }
 
   if $::lsbdistid == 'LinuxMint' {
-    $distid = $::lsbdistcodename ? {
-      'debian' => 'debian',
-      default  => 'ubuntu',
-    }
-    $release_real = $::lsbdistcodename ? {
-      'debian' => 'wheezy',
-      'qiana'  => 'trusty',
-      'petra'  => 'saucy',
-      'olivia' => 'raring',
-      'nadia'  => 'quantal',
-      'maya'   => 'precise',
+    if $::lsbdistcodename == 'debian' {
+      $distid = 'debian'
+      $release_real = 'wheezy'
+    } else {
+      $distid = 'ubuntu'
+      $release_real = $::lsbdistcodename ? {
+        'qiana'  => 'trusty',
+        'petra'  => 'saucy',
+        'olivia' => 'raring',
+        'nadia'  => 'quantal',
+        'maya'   => 'precise',
+      }
     }
   } else {
     $distid = $::lsbdistid
@@ -65,12 +66,17 @@ class apt::backports(
     'ubuntu' => 'main universe multiverse restricted',
   }
 
+  apt::pin { 'backports':
+    before   => Apt::Source['backports'],
+    release  => "${release_real}-backports",
+    priority => $pin_priority,
+  }
+
   apt::source { 'backports':
     location   => $location,
     release    => "${release_real}-backports",
     repos      => $repos,
     key        => $key,
     key_server => 'pgp.mit.edu',
-    pin        => $pin_priority,
   }
 }