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

apt_repository module requires gpg to be installed target, but docs don't mention #76133

Closed
1 task done
zoredache opened this issue Oct 25, 2021 · 11 comments · Fixed by #78586
Closed
1 task done

apt_repository module requires gpg to be installed target, but docs don't mention #76133

zoredache opened this issue Oct 25, 2021 · 11 comments · Fixed by #78586
Labels
affects_2.13 docs This issue/PR relates to or includes documentation. easyfix This issue is considered easy to fix by aspiring contributors. has_pr This issue has an associated PR. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team. waiting_on_contributor This would be accepted but there are no plans to actively work on it.

Comments

@zoredache
Copy link
Contributor

zoredache commented Oct 25, 2021

Summary

The apt_repository will fail with a somewhat confusing error if gnugp, and dirmngr manager are not installed. Neither of these packages are Required/Essential/Important, and may not be already installed in minimal systems that you might want to run apt_repository on.

The fix might be to just include gnupg in the requirements section of the docs.

Issue Type

Documentation Report

Component Name

apt_repository

Ansible Version

$  ansible --version
ansible [core 2.11.4]
  config file = ...
  configured module search path = ...
  ansible python module location = ...
  ansible collection location = ...
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
  jinja version = 3.0.1
  libyaml = True

Configuration

$ ansible-config dump --only-changed

OS / Environment

Mostly a docs issue so this is N/A. But apt_repository applies to Debian, Ubuntu, and forks.

Additional Information

Tells people that need gnupg when using apt_repository.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot
Copy link
Contributor

ansibot commented Oct 25, 2021

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.13 docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 25, 2021
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Oct 26, 2021
@bcoca
Copy link
Member

bcoca commented Oct 26, 2021

the real dependency is apt-key, which itself requires gpg

also note that apt-key is deprecated and we should look to using the new way of accepting repositories in debian

@bcoca bcoca added the P3 Priority 3 - Approved, No Time Limitation label Oct 26, 2021
@tigerblue77
Copy link

I transformed my

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367

to

gpg --keyserver keyserver.ubuntu.com --recv 93C4A3FD7BB9C367 && \
gpg --export 93C4A3FD7BB9C367 > /usr/share/keyrings/ansible-archive-keyring.gpg

thanks to this topic. Don't hesitate to suggest improvments :)

@samccann
Copy link
Contributor

@bcoca the docs fix here seems quite simple - add gpg to the requirements on the apt_repository module. But I'm unsure if you want to keep this ticket open for a bugfix to change apt_key to something else because it's deprecated?

@bcoca
Copy link
Member

bcoca commented Aug 11, 2022

since then i've updated apt_repository to use gpg in case apt-key is not present so 'requirements: apt-key or gpg

@samccann
Copy link
Contributor

Documentation fix:

Add a line above https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/apt_repository.py#L102
That says:

  • apt-key or gpg

@samccann samccann added easyfix This issue is considered easy to fix by aspiring contributors. waiting_on_contributor This would be accepted but there are no plans to actively work on it. labels Aug 11, 2022
@tigerblue77
Copy link

@bcoca As apt-key is deprecated, you should probably only use gpg and install it automatically if needed

@bcoca
Copy link
Member

bcoca commented Aug 11, 2022

@tigerblue77 it is a fallback for now as people tend to keep things around much longer than they should and the module should work for them too.

@akamanzi
Copy link
Contributor

@samccann @bcoca I can update the requirements section if that's the fix and if no one has taken on this issue

@samccann
Copy link
Contributor

Sounds good, thanks @akamanzi !!

@ansibot ansibot added the has_pr This issue has an associated PR. label Aug 18, 2022
@akamanzi
Copy link
Contributor

@samccann, check PR #78586

@ansible ansible locked and limited conversation to collaborators Aug 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.13 docs This issue/PR relates to or includes documentation. easyfix This issue is considered easy to fix by aspiring contributors. has_pr This issue has an associated PR. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team. waiting_on_contributor This would be accepted but there are no plans to actively work on it.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants