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

fact YumRepositories should include the repo filename #1042

Open
disser opened this issue Nov 26, 2023 · 1 comment
Open

fact YumRepositories should include the repo filename #1042

disser opened this issue Nov 26, 2023 · 1 comment
Labels
Facts Issues with facts.

Comments

@disser
Copy link
Contributor

disser commented Nov 26, 2023

Is your feature request related to a problem? Please describe

The pattern of inspecting repositories and removing some is not possible because the .repo filename is not provided by the YumRepositories fact, but yum.repo(..., present=False) requires the filename of the repo.

Describe the solution you'd like

YumRepositories should return output including the filename:

[
    {
        "name": "CentOS-$releasever - Apps",
        "baseurl": "http://mirror.centos.org/$contentdir/$releasever/Apps/$basearch/os/",
        "gpgcheck": "1",
        "enabled": "1",
        "gpgkey": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial",
        "filename": "/etc/yum.repos.d/centos.repo"
    },
]

I'm not sure if the full path should be included, since yum.repo doesn't expect it.

EDIT: oh... I see now how this would be impossible given the current implementation of YumRepositories

@Fizzadar
Copy link
Member

Potential solution using tail instead of cat: https://stackoverflow.com/a/7816490

Would be nice to have in there for sure, but non-essential. If added the yum.repo operation could end up duplicating repos in multiple files, or it would need to error if the repo was found somewhere unexpected (or remove it, could get messy).

@Fizzadar Fizzadar added the Facts Issues with facts. label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Facts Issues with facts.
Projects
None yet
Development

No branches or pull requests

2 participants