2 Optional[Variant[String, Stdlib::Compat::String]] $location = undef,
3 Optional[Variant[String, Stdlib::Compat::String]] $release = undef,
4 Optional[Variant[String, Stdlib::Compat::String]] $repos = undef,
5 Optional[Variant[String, Stdlib::Compat::String, Hash, Stdlib::Compat::Hash]] $key = undef,
6 Optional[Variant[Integer, Stdlib::Compat::Integer, String, Stdlib::Compat::String, Hash, Stdlib::Compat::Hash]] $pin = 200,
9 validate_legacy(String, 'validate_string', $location)
10 $_location = $location
13 validate_legacy(String, 'validate_string', $release)
17 validate_legacy(String, 'validate_string', $repos)
21 unless is_hash($key) {
22 validate_legacy(String, 'validate_string', $key)
26 if ($facts['lsbdistid'] == 'Debian' or $facts['lsbdistid'] == 'Ubuntu') {
28 $_location = $::apt::backports['location']
31 $_release = "${facts['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,