ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
827 stars 1.52k forks source link

Cannot limit packages for copr #8738

Closed ossman closed 1 week ago

ossman commented 3 months ago

Summary

When adding a copr repository, you generally want it for some specific thing. Therefore, it's prudent to limit DNF to only grab those specific packages from that repository and not get surprises in case the repository gets new things in the future.

Right now, that is very annoying with the copr module. It doesn't have that feature, which is fine as you can pair it with a ini_file task right after. However, the copr module resets the configuration and removes those changes every time it is run. So your ansible run is constantly considering those tasks changed.

Issue Type

Feature Idea

Component Name

copr

Additional Information

- name: add shorewall copr
  community.general.copr:
    name: ufven/epel9-extras
    state: enabled
    chroot: epel-9-x86_64

- name: limit shorewall copr
  ini_file:
    path: /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:ufven:epel9-extras.repo
    section: copr:copr.fedorainfracloud.org:ufven:epel9-extras
    option: includepkgs
    value: "shorewall*"

Code of Conduct

ansibullbot commented 3 months ago

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

ansibullbot commented 3 months ago

cc @schlupov click here for bot help

shubhamsugara22 commented 2 months ago

from what i understand you want the copr module should be enhanced to include an option for limiting the packages retrieved from the repository, such as includepkgs. then users can avoid the need for a separate init_file task, and the repository configuration will remain consistent across Ansible runs. This new includepkgs option would be handled by the module and written directly into the repository configuration file https://github.com/ansible-collections/community.general/blob/main/plugins/modules/copr.py Am i Right or is there anything else you wanted to point out ?

ossman commented 2 months ago

That is the ideal, yes.

But there is also the intermediate step where the copr module should stop resetting the file if all the fields it cares about are correct. Right now, adding a separate ini_file task is not a good workaround because the copr task keeps undoing its work.

russoz commented 2 months ago

hi @ossman is this issue solved with #8779 ? Should we close it?

felixfontein commented 2 months ago

needs_info

ansibullbot commented 1 month ago

@ossman This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

ansibullbot commented 1 week ago

@ossman You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help