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

Add both GPG keys when installing repos on SLES #157

Merged
merged 2 commits into from
Feb 5, 2021

Conversation

GabrielNagy
Copy link
Contributor

We recently updated packages to be signed with the new GPG key (puppet-20250406), so for the time being install both the old and the new GPG key.

We recently updated packages to be signed with the new GPG key
(puppet-20250406), so for the time being install both the old and the
new GPG key.
@GabrielNagy
Copy link
Contributor Author

ping @ekohl @bastelfreak, can't add reviewers to the PR 😄

Copy link
Contributor

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you want to address my feedback or merge it.

on host, "wget -O /tmp/puppet-gpg-key http://yum.puppetlabs.com/RPM-GPG-KEY-puppet"
on host, "rpm --import /tmp/puppet-gpg-key"
%w[puppet puppet-20250406].each do |gpg_key|
on host, "wget -O /tmp/#{gpg_key} http://yum.puppetlabs.com/RPM-GPG-KEY-#{gpg_key}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're at it: is this still the correct URL or is puppet.com preferred nowadays? I'd also consider fetching over HTTPS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think puppet.com is preferred, I'll update

%w[puppet puppet-20250406].each do |gpg_key|
on host, "wget -O /tmp/#{gpg_key} http://yum.puppetlabs.com/RPM-GPG-KEY-#{gpg_key}"
on host, "rpm --import /tmp/#{gpg_key}"
on host, "rm -f /tmp/#{gpg_key}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I'd suggest to avoid the temporary file altogether by using rpm --import <(wget -O - $URL) but I don't know if it works here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this doesn't work as expected (tested on SLES 12):

tragic-yarn:~ # rpm --import <(wget -q -O - https://yum.puppet.com/RPM-GPG-KEY-puppet)
error: /dev/fd/63: import read failed(0).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rpmkeys --import can take a URL directly on Fedora, but just gives import read failed(2) on openSUSE Tumbleweed for some reason, even though it's using the same version of rpm. 🤷‍♂️

@GabrielNagy
Copy link
Contributor Author

I'll update and kick off a test pipeline to see if everything works properly, will let you know once it's done.

@GabrielNagy
Copy link
Contributor Author

@ekohl everything seems to be passing so this is good to merge. Thanks!

@ekohl ekohl merged commit 9bd12f4 into puppetlabs:master Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants