Skip to content

Commit

Permalink
Merge pull request #1129 from kenyon/ubuntu-backport-gpg-key
Browse files Browse the repository at this point in the history
backports: don't hardcode an old gpg key for Ubuntu
  • Loading branch information
bastelfreak authored Nov 21, 2023
2 parents 782a790 + f867561 commit bee5ee1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
7 changes: 1 addition & 6 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
16 changes: 3 additions & 13 deletions manifests/backports.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -88,9 +81,6 @@
unless $repos {
$_repos = $apt::backports['repos']
}
unless $key {
$_key = $apt::backports['key']
}

if $pin =~ Hash {
$_pin = $pin
Expand All @@ -110,7 +100,7 @@
release => $_release,
repos => $_repos,
include => $include,
key => $_key,
key => $key,
pin => $_pin,
}
}
1 change: 0 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
'Ubuntu': {
$backports = {
'location' => 'http://archive.ubuntu.com/ubuntu',
'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5',
'repos' => 'main universe multiverse restricted',
}
$ppa_options = ['-y']
Expand Down
13 changes: 6 additions & 7 deletions spec/classes/apt_backports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
full: '18.04'
},
distro: {
codename: 'bionac',
codename: 'bionic',
id: 'Ubuntu'
}
}
Expand All @@ -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

Expand All @@ -70,7 +69,7 @@
full: '18.04'
},
distro: {
codename: 'bionac',
codename: 'bionic',
id: 'Ubuntu'
}
}
Expand Down Expand Up @@ -106,7 +105,7 @@
full: '18.04'
},
distro: {
codename: 'bionac',
codename: 'bionic',
id: 'Ubuntu'
}
}
Expand Down Expand Up @@ -235,7 +234,7 @@
full: '18.04'
},
distro: {
codename: 'bionac',
codename: 'bionic',
id: 'Ubuntu'
}
}
Expand Down

0 comments on commit bee5ee1

Please sign in to comment.