From 8171922de7d50e5eba4a70e1d818b133973cbf17 Mon Sep 17 00:00:00 2001 From: Radar231 Date: Mon, 3 Jan 2022 10:08:27 -0500 Subject: [PATCH] cleanup: removed centos code, cleaned up debian & ubuntu references --- README.md | 2 -- tasks/main.yml | 14 +++----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 133e2c2..754e58a 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,3 @@ 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. - diff --git a/tasks/main.yml b/tasks/main.yml index 9957a63..9331a24 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,36 +5,28 @@ # # 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 (Ubuntu) +- name: Upgraded packages (Debian based repos) apt: name: "*" state: latest when: ansible_os_family == "Debian" -- name: Clean up the autoremove packages (Ubuntu) +- name: Clean up the autoremove packages (Debian based repos) apt: autoremove: true purge: true when: ansible_os_family == "Debian" -- name: Clean up any packages left in the 'rc' state (Ubuntu) +- name: Clean up any packages left in the 'rc' state (Debina based repos) shell: cmd: /usr/bin/apt -y --purge remove $(dpkg -l | grep "^rc " | sed 's/ \+/ /g' | cut -d ' ' -f2) when: ansible_os_family == "Debian" -- name: Upgraded packages (CentOS) - yum: - name: "*" - state: latest - when: ansible_distribution == "CentOS" - - name: Upgraded packages (Alpine) apk: upgrade: yes