Compare commits

..

No commits in common. "master" and "8162c65aa212720c25ff6bdeb84e2afa8070d7ff" have entirely different histories.

2 changed files with 15 additions and 11 deletions

View File

@ -6,3 +6,5 @@ This role will apply available package upgrades to the target host.
The 'update_cache' role should be run before running this role.
This role should work for both Ubuntu as well as CentOS based target hosts.

View File

@ -5,32 +5,34 @@
#
# The 'update_cache' role should be run before running this role.
#
# This role should work for both Ubuntu as well as CentOS based target hosts.
#
###########################################################################
# tasks file for upgrade_pkgs
- debug: msg="Applying package updates"
- name: Upgraded packages (Debian based distros)
- name: Upgraded packages (Ubuntu)
apt:
name: "*"
state: latest
when: ansible_os_family == "Debian"
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Pop!_OS"
- name: Clean up the autoremove packages (Debian based distros)
- name: Clean up the autoremove packages (Ubuntu)
apt:
autoremove: true
purge: true
when: ansible_os_family == "Debian"
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Pop!_OS"
- name: Clean up any packages left in the 'rc' state (Debian based distros)
- 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_os_family == "Debian"
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Pop!_OS"
- name: Upgraded packages (Arch based distros)
pacman:
update_cache: true
upgrade: true
when: ansible_os_family == "Archlinux"
- name: Upgraded packages (CentOS)
yum:
name: "*"
state: latest
when: ansible_distribution == "CentOS"
# EOF