Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
    : 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
  • Loading branch information
TimRots committed May 31, 2018
1 parent b222bd6 commit 6658d4e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tasks/main.yml
Expand Up @@ -76,16 +76,20 @@
- include_tasks: vmware.yml
when: vmware_check.rc == 0

# Cleanup tasks.
# Handler for 'yum clean all' command whichs in effect runs yum clean packages and yum clean headers
- name: yum-clean-all
command: yum clean all
args:
warn: no

# Cleanup tasks
- name: Remove unneeded packages.
yum: "name={{ item }} state=absent"
with_items:
- cpp
- kernel-devel
- kernel-headers

- name: Clean up yum.
command: yum clean all
notify: yum-clean-all

- name: Remove any remnants of VirtualBox ISOs.
shell: rm -rf VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.?
Expand Down

0 comments on commit 6658d4e

Please sign in to comment.