1 # Defining backports for the apt class
3 Optional[String] $location = undef,
4 Optional[String] $release = undef,
5 Optional[String] $repos = undef,
6 Optional[Variant[String, Hash]] $key = undef,
7 Optional[Variant[Integer, String, Hash]] $pin = 200,
10 $_location = $location
21 if ($facts['lsbdistid'] == 'Debian' or $facts['lsbdistid'] == 'Ubuntu') {
23 $_location = $::apt::backports['location']
26 $_release = "${facts['lsbdistcodename']}-backports"
29 $_repos = $::apt::backports['repos']
32 $_key = $::apt::backports['key']
35 unless $location and $release and $repos and $key {
36 fail('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key')
42 } elsif $pin =~ Numeric or $pin =~ String {
43 # apt::source defaults to pinning to origin, but we should pin to release
47 'release' => $_release,
50 fail('pin must be either a string, number or hash')
53 apt::source { 'backports':
54 location => $_location,