2 Optional[String] $location = undef,
3 Optional[String] $release = undef,
4 Optional[String] $repos = undef,
5 Optional[Variant[String, Hash]] $key = undef,
6 Optional[Variant[Integer, String, Hash]] $pin = 200,
20 if ($facts['lsbdistid'] == 'Debian' or $facts['lsbdistid'] == 'Ubuntu') {
22 $_location = $::apt::backports['location']
25 $_release = "${facts['lsbdistcodename']}-backports"
28 $_repos = $::apt::backports['repos']
31 $_key = $::apt::backports['key']
34 unless $location and $release and $repos and $key {
35 fail('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key')
41 } elsif is_numeric($pin) or is_string($pin) {
42 # apt::source defaults to pinning to origin, but we should pin to release
46 'release' => $_release,
49 fail('pin must be either a string, number or hash')
52 apt::source { 'backports':
53 location => $_location,