changed from ansible_distribution to ansible_os_family

This commit is contained in:
Radar231 2021-12-30 14:22:13 -05:00
parent c3c1a3c7dc
commit a294967baf
1 changed files with 3 additions and 3 deletions

View File

@ -16,18 +16,18 @@
apt:
name: "*"
state: latest
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Pop!_OS" or ansible_distribution == "Linux Mint"
when: ansible_os_family == "Debian"
- name: Clean up the autoremove packages (Ubuntu)
apt:
autoremove: true
purge: true
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Pop!_OS" or ansible_distribution == "Linux Mint"
when: ansible_os_family == "Debian"
- name: Clean up any packages left in the 'rc' state (Ubuntu)
shell:
cmd: /usr/bin/apt -y --purge remove $(dpkg -l | grep "^rc " | sed 's/ \+/ /g' | cut -d ' ' -f2)
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Pop!_OS" or ansible_distribution == "Linux Mint"
when: ansible_os_family == "Debian"
- name: Upgraded packages (CentOS)
yum: