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

yum_repository shouldn't require baseurl/metalink/mirrorlist to disable a repository #41178

Closed
rgarrigue opened this issue Jun 6, 2018 · 10 comments
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bot_closed feature This issue/PR relates to a feature request. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@rgarrigue
Copy link

SUMMARY

With yum on CentOS and most likely RHEL, Fedora, you might want to get rid of OS repositories in favor of local mirror. If you remove them, the OS might re-create them at the next yum update, so personnaly I disable them.

But ansile can't disable (enabled=false) a yum_repository without knowing its baseurl/metalink/mirrorlist. It can just remove it (state=absent).

I wish enabled=false behave the same way as state=absent, just find the unique [reponame] in the files without caring about baseurl & so on, which might change over time

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

yum_repository

@ansibot
Copy link
Contributor

ansibot commented Jun 6, 2018

Files identified in the description:

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

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jun 6, 2018

cc @jtyr
click here for bot help

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 feature This issue/PR relates to a feature request. 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 Jun 6, 2018
@jtyr
Copy link
Contributor

jtyr commented Jun 6, 2018

Thanks for opening this issue. I will try to look into it.

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Jun 6, 2018
@ansiblejunky
Copy link

Yes, the yum_repository module should handle this similarly to how the `rhsm_repository' module handles it.

The `rhsm_repository' module allows for this simple way to disable all repos:

- name: Disable all RHSM repositories
  rhsm_repository:
    name: '*'
    state: disabled

Therefore, the yum_repository module should allow for the following, without user having to know about files or repo ID or anything else really. The user is simply trying to disable all repos managed by Yum.

- name: Disable all RHSM repositories
  yum_repository:
    name: '*'
    state: disabled

I had a customer recently who wanted to provision their servers to prepare for an Ansible Tower installation. So we wanted to cleanup any defined repos for both Yum managed and RHSM managed.

@markusdd
Copy link

markusdd commented Jul 13, 2018

I strongly want to support this idea, because I just ran across the exact same issue.
I'm currently writing a playbook which pre-configures our nodes for an openshift deployment, where the official instructions want you to disable EPEL from a certain point on.

EPEL is installed on CentOS 7 via epel-release, so I absolutely do not care what the URLs etc are.

I just want:

  - name: Deactivate EPEL
    yum_repository:
        name: epel
        state: present
        enabled: no

By the way, this would also serve as a sanity check. When you specify state present without any repo info, and the file is not there (because yum install epel-release failed in some strange way), you would correctly error out.

@ansibot ansibot added the packaging Packaging category label Feb 17, 2019
@ansibot
Copy link
Contributor

ansibot commented May 16, 2020

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

@relrod relrod added P3 Priority 3 - Approved, No Time Limitation waiting_on_contributor This would be accepted but there are no plans to actively work on it. labels Mar 26, 2021
@MichaelDBA
Copy link

Anyone planning on fixing this issue anytime soon?

@ansibot
Copy link
Contributor

ansibot commented Apr 12, 2022

Thank you very much for your submission to Ansible. It means a lot to us that you've taken time to contribute.

Unfortunately, this issue has been open for some time while waiting for a contributor to take it up but there does not seem to have been anyone that did so. So we are going to close this issue to clear up the queues and make it easier for contributors to browse possible implementation targets.

However, we're absolutely always up for discussion. Because this project is very active, we're unlikely to see comments made on closed tickets and we lock them after some time. If you or anyone else has any further questions, please let us know by using any of the communication methods listed in the page below:

In the future, sometimes starting a discussion on the development list prior to proposing or implementing a feature can make getting things included a little easier, but it's not always necessary.

Thank you once again for this and your interest in Ansible!

click here for bot help

@ansibot ansibot added bot_closed and removed waiting_on_contributor This would be accepted but there are no plans to actively work on it. labels Apr 12, 2022
@ansibot ansibot closed this as completed Apr 12, 2022
@markusdd
Copy link

don't get why this is being closed.

this is still aproblem until this day.

@mkrizek
Copy link
Contributor

mkrizek commented Apr 12, 2022

@markusdd The functionality can still implemented, anyone is free to send a PR but no one has done so while the issue has been open for a long time.

@ansible ansible locked and limited conversation to collaborators Apr 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bot_closed feature This issue/PR relates to a feature request. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

8 participants