cleanup: removed centos code, cleaned up debian & ubuntu references
This commit is contained in:
parent
2a2548550b
commit
8171922de7
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue