9 validate_string($location)
10 $_location = $location
13 validate_string($release)
17 validate_string($repos)
21 unless is_hash($key) {
26 if ($::apt::xfacts['lsbdistid'] == 'debian' or $::apt::xfacts['lsbdistid'] == 'ubuntu') {
28 $_location = $::apt::backports['location']
31 $_release = "${::apt::xfacts['lsbdistcodename']}-backports"
34 $_repos = $::apt::backports['repos']
37 $_key = $::apt::backports['key']
40 unless $location and $release and $repos and $key {
41 fail('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key')
47 } elsif is_numeric($pin) or is_string($pin) {
48 # apt::source defaults to pinning to origin, but we should pin to release
52 'release' => $_release,
55 fail('pin must be either a string, number or hash')
58 apt::source { 'backports':
59 location => $_location,