diff --git a/REFERENCE.md b/REFERENCE.md index f4e31a20cf..92d1b0374a 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -470,12 +470,7 @@ Default value: `undef` Data type: `Optional[Variant[String, Hash]]` Specifies a key to authenticate the backports. Valid options: a string to be passed to the id parameter of the apt::key defined type, or a -hash of parameter => value pairs to be passed to apt::key's id, server, content, source, and/or options parameters. Default value -for Debian and Ubuntu varies: - -- Debian: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' - -- Ubuntu: '630239CC130E1A7FD81A27B140976EAF437D05B5' +hash of parameter => value pairs to be passed to apt::key's id, server, content, source, and/or options parameters. Default value: `undef` diff --git a/manifests/backports.pp b/manifests/backports.pp index 0ef45333d5..8cb32eb1c9 100644 --- a/manifests/backports.pp +++ b/manifests/backports.pp @@ -34,12 +34,7 @@ # # @param key # Specifies a key to authenticate the backports. Valid options: a string to be passed to the id parameter of the apt::key defined type, or a -# hash of parameter => value pairs to be passed to apt::key's id, server, content, source, and/or options parameters. Default value -# for Debian and Ubuntu varies: -# -# - Debian: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' -# -# - Ubuntu: '630239CC130E1A7FD81A27B140976EAF437D05B5' +# hash of parameter => value pairs to be passed to apt::key's id, server, content, source, and/or options parameters. # # @param pin # Specifies a pin priority for the backports. Valid options: a number or string to be passed to the `id` parameter of the `apt::pin` defined @@ -67,9 +62,7 @@ if $repos { $_repos = $repos } - if $key { - $_key = $key - } + if (!($facts['os']['name'] == 'Debian' or $facts['os']['name'] == 'Ubuntu')) { unless $location and $release and $repos and $key { fail('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key') @@ -88,9 +81,6 @@ unless $repos { $_repos = $apt::backports['repos'] } - unless $key { - $_key = $apt::backports['key'] - } if $pin =~ Hash { $_pin = $pin @@ -110,7 +100,7 @@ release => $_release, repos => $_repos, include => $include, - key => $_key, + key => $key, pin => $_pin, } } diff --git a/manifests/params.pp b/manifests/params.pp index 3ce8f48640..c2fe0b48b1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -88,7 +88,6 @@ 'Ubuntu': { $backports = { 'location' => 'http://archive.ubuntu.com/ubuntu', - 'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5', 'repos' => 'main universe multiverse restricted', } $ppa_options = ['-y'] diff --git a/spec/classes/apt_backports_spec.rb b/spec/classes/apt_backports_spec.rb index e7a951a758..cb2d421d50 100644 --- a/spec/classes/apt_backports_spec.rb +++ b/spec/classes/apt_backports_spec.rb @@ -43,7 +43,7 @@ full: '18.04' }, distro: { - codename: 'bionac', + codename: 'bionic', id: 'Ubuntu' } } @@ -52,10 +52,9 @@ it { expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu', - key: '630239CC130E1A7FD81A27B140976EAF437D05B5', repos: 'main universe multiverse restricted', - release: 'bionac-backports', - pin: { 'priority' => 200, 'release' => 'bionac-backports' }) + release: 'bionic-backports', + pin: { 'priority' => 200, 'release' => 'bionic-backports' }) } end @@ -70,7 +69,7 @@ full: '18.04' }, distro: { - codename: 'bionac', + codename: 'bionic', id: 'Ubuntu' } } @@ -106,7 +105,7 @@ full: '18.04' }, distro: { - codename: 'bionac', + codename: 'bionic', id: 'Ubuntu' } } @@ -235,7 +234,7 @@ full: '18.04' }, distro: { - codename: 'bionac', + codename: 'bionic', id: 'Ubuntu' } }