Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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