summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/packaging/os
diff options
context:
space:
mode:
authorDag Wieers <dag@wieers.com>2017-01-05 19:30:37 +0100
committerMatt Davis <nitzmahone@users.noreply.github.com>2017-01-05 10:30:37 -0800
commite1fe40307500ab1566d7add7dc3eb8171fb744ce (patch)
tree3f984e72b205792fb7878fc2896c84e2e4006e6c /lib/ansible/modules/packaging/os
parent74db76ec9c5da55c77356842c047c81a1e8e6444 (diff)
downloadansible-e1fe40307500ab1566d7add7dc3eb8171fb744ce.tar.gz
Inform user that the yum metadata cache remains (#19753)
This PR improves the documentation so that it is clear that this module does not clean the repository metadata cache on removal, and add an example notification handler to the removal example as an extra reminder. This fixes #19730
Diffstat (limited to 'lib/ansible/modules/packaging/os')
-rw-r--r--lib/ansible/modules/packaging/os/yum_repository.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ansible/modules/packaging/os/yum_repository.py b/lib/ansible/modules/packaging/os/yum_repository.py
index 1d00d26f68..59750fac57 100644
--- a/lib/ansible/modules/packaging/os/yum_repository.py
+++ b/lib/ansible/modules/packaging/os/yum_repository.py
@@ -398,6 +398,8 @@ notes:
- Parameters in a section are ordered alphabetically in an existing repo
file.
- The repo file will be automatically deleted if it contains no repository.
+ - When removing a repository, beware that the metadata cache may still remain
+ on disk until you run C(yum clean all). Use a notification handler for this.
'''
EXAMPLES = '''
@@ -424,10 +426,18 @@ EXAMPLES = '''
mirrorlist: http://mirrorlist.repoforge.org/el7/mirrors-rpmforge
enabled: no
-- name: Remove repository
+# Handler showing how to clean yum metadata cache
+- name: yum-clean-metadata
+ command: yum clean metadata
+ args:
+ warn: no
+
+# Example removing a repository and cleaning up metadata cache
+- name: Remove repository (and clean up left-over metadata)
yum_repository:
name: epel
state: absent
+ notify: yum-clean-all
- name: Remove repository from a specific repo file
yum_repository: