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

update apt sources, add apt keyring gpg #150

Merged
merged 4 commits into from
Mar 5, 2024

Conversation

rdxmb
Copy link
Contributor

@rdxmb rdxmb commented Nov 7, 2023

@rdxmb rdxmb marked this pull request as draft November 7, 2023 03:03
@rdxmb
Copy link
Contributor Author

rdxmb commented Nov 7, 2023

I've searched for a solution without using the shell module, but all of them were even more ugly ...

Any other ideas for that?

Thanks for your feedback!

(ps. Ok, saving as .asc does not need dearmor, so this will be the way to go)

kubernetes_apt_ignore_key_error: false
# this one is deprecated and will be deleted with this role
kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ kubernetes_apt_release_channel }}"
Copy link
Contributor Author

@rdxmb rdxmb Nov 7, 2023

Choose a reason for hiding this comment

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

we could set kubernetes_apt_repository to the new one.

- name: Be sure deprecated Kubernetes repository is absent.
file:
path: "/etc/apt/sources.list.d/apt_kubernetes_io.list"
state: absent
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if there is a safe way to do that with apt_repository, please let me know

@geerlingguy
Copy link
Owner

@rdxmb rdxmb mentioned this pull request Nov 7, 2023
@rdxmb
Copy link
Contributor Author

rdxmb commented Nov 7, 2023

@geerlingguy yes, I have already seen that. However, /etc/apt/trusted.gpg.d/ does not seem to be the recommended way. Most docs recommend to add the signing key explicitly to the source.

The trick seems to be the .asc here, so I will change that.

What about the other stuff with deleting the old source?

@rdxmb rdxmb marked this pull request as ready for review November 7, 2023 14:20
@rdxmb
Copy link
Contributor Author

rdxmb commented Nov 7, 2023

ready for review.

@geerlingguy
Copy link
Owner

@rdxmb - I realized my edit to that blog post may have not taken effect; there's a newer/simpler way to do it correctly using Ansible's ansible.builtin.deb822_repository module. This only works in Ansible 2.15+, so the role meta version requirement would need to be bumped too if we go that route. But it seems like that would be the cleanest method.

@rdxmb
Copy link
Contributor Author

rdxmb commented Nov 7, 2023

to be honest, I didn't realize the upgrade on your blog post.

Maybe I will have a look at deb822_repository, at the moment this PR works for my environment.

@ndouglas
Copy link

ndouglas commented Mar 1, 2024

I opened a similar PR, #153, because I had a miserable time getting deb822_repository to work for me. I finally did, but I want to make clear that my PR is largely untested (I'm not actually using this project) and there is some cleanup work that needs to be done as part of the migration if you're working with an existing cluster.

@rhino5oh
Copy link

rhino5oh commented Mar 5, 2024

@geerlingguy Can we get either this PR in or make some progress on #153? The current repos have been deprecated since August 2023 and this role has been broken in its current state since January 31st...

@geerlingguy geerlingguy merged commit 928c143 into geerlingguy:master Mar 5, 2024
5 checks passed
@geerlingguy
Copy link
Owner

Merging this for now — I would like to move to deb822_repository at some point of course :)

@rhino5oh
Copy link

rhino5oh commented Mar 6, 2024

@geerlingguy Thank you! Can you tag the repo with these changes as well?

@rhino5oh
Copy link

rhino5oh commented Mar 6, 2024

I just realized that this PR did not update the yum repository as well, which should have probably be done at the same time. I can try to work up a PR for that....even one that attempts to use deb822_repository, since it looks like #153 doesn't update the yum repo either

@geerlingguy
Copy link
Owner

@rhino5oh - oh haha, that makes sense, and I would gladly merge a PR updating yum/dnf too!

@geerlingguy
Copy link
Owner

I've pushed a commit that should hopefully fix yum.

geerlingguy added a commit that referenced this pull request Mar 6, 2024
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.

Changes to the location of Linux packages for Kubernetes Add Kubernetes apt key fails
4 participants