Update packages role to better handle cent7 vs 8

This commit is contained in:
2019-12-01 14:46:49 -05:00
parent d5fdbbb9aa
commit b98e464f07
4 changed files with 39 additions and 7 deletions

View File

@@ -1,7 +1,14 @@
---
- name: Clean DNF cache
become: true
when: ansible_distribution == "Fedora" or ansible_distribution == "CentOS"
when: ansible_distribution == "Fedora" or (ansible_distribution == "CentOS" and ansible_distribution_major_version == "8")
shell:
cmd: dnf clean all
warn: false
- name: Clean YUM cache
become: true
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
shell:
cmd: yum clean all
warn: false