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

Add 'yum clean' option #31450

Closed
wants to merge 3 commits into from
Closed

Add 'yum clean' option #31450

wants to merge 3 commits into from

Conversation

sengaya
Copy link
Contributor

@sengaya sengaya commented Oct 8, 2017

SUMMARY

This patch adds the option "clean" to the yum module

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

yum

ANSIBLE VERSION

latest git

ADDITIONAL INFORMATION

yum has the option to clean caches with yum clean <option>

Valid options: [headers|packages|metadata|dbcache|plugins|expire-cache|all]

@ansibot
Copy link
Contributor

ansibot commented Oct 8, 2017

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 core_review In order to be merged, this PR must follow the core review workflow. feature_pull_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 Oct 8, 2017
@ansibot
Copy link
Contributor

ansibot commented Oct 8, 2017

The test ansible-test sanity --test validate-modules [?] failed with the following error:

lib/ansible/modules/packaging/os/yum.py:0:0: E309 version_added for new option (clean) should be 2.5. Currently 0.0

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Oct 8, 2017
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 8, 2017
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Oct 9, 2017
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 17, 2017
@maxamillion
Copy link
Contributor

This was discussed during today's Ansible Core development community irc meeting and the consensus was that since this operation can not be done in an idempotent way, it does not add any value to the module but does add to the maintenance burden of the module. Ultimately for this kind of functionality, the command or shell modules should be used to issue the command itself.

@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 5, 2018
TimRots added a commit to TimRots/ansible-role-packer-rhel that referenced this pull request May 31, 2018
    : TASK [geerlingguy.packer-rhel : Clean up yum.] *********************************
    :  [WARNING]: Consider using yum module rather than running yum

To suppress this warning, a workaround can be applied via a notification handler as per documentation[1]. Reasoning for s/workaround/hack/ can be found in [2]'s last comment.

[1] https://docs.ansible.com/ansible/2.4/yum_repository_module.html
[2] ansible/ansible#31450
TimRots added a commit to TimRots/ansible-role-packer-rhel that referenced this pull request May 31, 2018
    : TASK [geerlingguy.packer-rhel : Clean up yum.] *********************************
    :  [WARNING]: Consider using yum module rather than running yum

To suppress this warning, a workaround can be applied via a notification handler as per documentation[1]. Reasoning for specific s/workaround/hack/ can be found in the last comment of PR[2].

[1] https://docs.ansible.com/ansible/2.4/yum_repository_module.html
[2] ansible/ansible#31450
@l1x
Copy link

l1x commented Oct 10, 2018

Since when is any yum command idempotent or since when this is a requirement to implement only idempotent operations in modules? This argument is silly at the very least.

biohazd added a commit to biohazd/ansible that referenced this pull request Oct 29, 2018
adding explanation why you must use "shell: yum clean all" and why it won't be included in the yum module as per ansible#31450 (comment)

+label: docsite_pr
@biohazd biohazd mentioned this pull request Oct 29, 2018
StephenSorriaux pushed a commit to StephenSorriaux/ansible that referenced this pull request Nov 7, 2018
add explanation why you must use "shell: yum clean all" and why it won't be included in the yum module as per ansible#31450 (comment)
@DylanYoung
Copy link

Can we suppress the warning then? ;)

mjmayer pushed a commit to mjmayer/ansible that referenced this pull request Nov 30, 2018
add explanation why you must use "shell: yum clean all" and why it won't be included in the yum module as per ansible#31450 (comment)
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
add explanation why you must use "shell: yum clean all" and why it won't be included in the yum module as per ansible#31450 (comment)
@dagwieers dagwieers added the packaging Packaging category label Mar 3, 2019
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. packaging Packaging category stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants