Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use apt::source keyring to fix apt-key deprecated warnings #885

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
dace42e
Use apt::source keyring to fix apt-key deprecated warnings
vegaaz Jan 2, 2023
0e75587
Change type to Stdlib::Absolutepath
vegaaz Jan 2, 2023
31a1d8c
Remove keyring-variable; not longer needed because of commit 0e75587b…
vegaaz Jan 2, 2023
ccd3074
Add param description
vegaaz Jan 3, 2023
46e2a9c
Use content => binary_file() instead of source
vegaaz Jan 3, 2023
d453a2b
Improve linting by removing obsolet spaces
vegaaz Jan 3, 2023
ee35dbb
Bump puppetlabs-apt required version to 8.1.0
vegaaz Jan 3, 2023
15bb484
Add param description in repos.pp
vegaaz Jan 3, 2023
9a8251c
Try unit tests
vegaaz Jan 4, 2023
006e604
Revert "Try unit tests"
vegaaz Jan 4, 2023
b3d5f7c
Working unit-test with STATIC keyring path (WIP)
vegaaz Jan 4, 2023
5373dea
Add additional unit-test; configure inheritance of param
vegaaz Jan 4, 2023
fe8cbe7
Satisfy Static & Syntax Tests
vegaaz Jan 4, 2023
d250ce3
Remove gpg-key from trusted.gpg store
vegaaz Jan 4, 2023
acce359
Add test for absence of docker-key
vegaaz Jan 4, 2023
04ef1a9
Correct syntax to satisfy static tests
vegaaz Jan 5, 2023
6dd2878
Remove trailing whitespace!
vegaaz Jan 5, 2023
a1b7602
Get keyring from official download.docker.com
vegaaz Jan 5, 2023
bc5ce1e
Remove not working tests
vegaaz Jan 5, 2023
ee6570d
Update manifests/init.pp
vegaaz Jan 12, 2023
84b217c
Update manifests/repos.pp
vegaaz Jan 12, 2023
177dfe6
Handle docker-Keyring download via archive-module
vegaaz Jan 17, 2023
19fa70a
Prepare Unit-Tests
vegaaz Jan 17, 2023
05d75b5
Add 'puppet/archive' Module as dependency
vegaaz Feb 3, 2023
8fdf2d5
Merge branch 'main' into main
vegaaz Feb 3, 2023
6c53719
remove lsb-release dependency, change to deb 11
vegaaz Feb 3, 2023
e5eab76
change upper and lower versions for archive dep
vegaaz Feb 3, 2023
75b70d8
Remove 'keyring_force_update' since not indempotent
vegaaz Feb 3, 2023
496b931
Change contribution information
vegaaz Feb 3, 2023
c4f50c7
metadata.json fix typo in version
vegaaz Feb 6, 2023
7238bd5
Satisfy Static & Syntax Tests
vegaaz Feb 7, 2023
d0582b0
Merge branch 'main' into main
vegaaz Mar 1, 2023
d83fb5b
Merge branch 'main' of github.com:vegaaz/puppetlabs-docker into main
vegaaz Mar 6, 2023
e6195fd
Merge branch 'main' into main
vegaaz Mar 21, 2023
400baac
Merge branch 'main' into main
vegaaz Apr 7, 2023
68958b2
Merge branch 'main' of https://github.com/vegaaz/puppetlabs-docker
vegaaz May 4, 2023
436a88a
Update metadata.json
vegaaz May 4, 2023
1ac0313
Merge branch 'main' into main
vegaaz Jul 2, 2023
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
Binary file added files/etc/apt/keyrings/docker.gpg
Binary file not shown.
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
# @param service_hasstatus
# @param service_hasrestart
# @param acknowledge_unsupported_os
# @param keyring
vegaaz marked this conversation as resolved.
Show resolved Hide resolved
#
class docker (
Optional[String] $version = $docker::params::version,
Expand Down Expand Up @@ -466,6 +467,7 @@
Optional[Boolean] $service_hasrestart = $docker::params::service_hasrestart,
Optional[Variant[String,Array]] $registry_mirror = $docker::params::registry_mirror,
Boolean $acknowledge_unsupported_os = false,
Stdlib::Absolutepath $keyring = '/etc/apt/keyrings/docker.gpg',

# Windows specific parameters
Optional[String] $docker_msft_provider_version = $docker::params::docker_msft_provider_version,
Expand Down
30 changes: 26 additions & 4 deletions manifests/repos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
#
# @param architecture
#
# @param keyring
vegaaz marked this conversation as resolved.
Show resolved Hide resolved
#
vegaaz marked this conversation as resolved.
Show resolved Hide resolved
class docker::repos (
$location = $docker::package_location,
$key_source = $docker::package_key_source,
$key_check_source = $docker::package_key_check_source,
$architecture = $facts['os']['architecture'],
$keyring = $docker::keyring,
) {
ensure_packages($docker::prerequired_packages)

Expand All @@ -22,19 +25,38 @@
$package_key = $docker::package_key
$package_repos = $docker::package_repos

if ( $facts['os']['distro']['id'] == 'Debian' and versioncmp($facts['os']['distro']['release']['major'],'10') >= 0 ) or ( $facts['os']['distro']['id'] == 'Ubuntu' and versioncmp($facts['os']['distro']['release']['major'],'22') >= 0 ) { # lint:ignore:140chars
vegaaz marked this conversation as resolved.
Show resolved Hide resolved
# fix deprecated apt-key warnings
file { $keyring:
ensure => file,
source => "puppet:///modules/${module_name}/etc/apt/keyrings/docker.gpg",
mode => '0644',
owner => 'root',
group => 'root',
vegaaz marked this conversation as resolved.
Show resolved Hide resolved
}
$key_options = {
keyring => $keyring,
}
}
else {
$key_options = {
key => {
id => $package_key,
source => $key_source,
vegaaz marked this conversation as resolved.
Show resolved Hide resolved
},
}
}

if ($docker::use_upstream_package_source) {
apt::source { 'docker':
location => $location,
architecture => $architecture,
release => $release,
repos => $package_repos,
key => {
id => $package_key,
source => $key_source,
},
include => {
src => false,
},
* => $key_options,
}

$url_split = split($location, '/')
Expand Down