initial checkin
This commit is contained in:
commit
a28a22722d
|
@ -0,0 +1,10 @@
|
||||||
|
# Ansible Role: upgrade_pkgs
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
---
|
||||||
|
###########################################################################
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
# tasks file for upgrade_pkgs
|
||||||
|
|
||||||
|
- debug: msg="Applying package updates"
|
||||||
|
|
||||||
|
- name: Upgraded packages (Ubuntu)
|
||||||
|
apt:
|
||||||
|
name: "*"
|
||||||
|
state: latest
|
||||||
|
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Pop!_OS"
|
||||||
|
|
||||||
|
- name: Clean up the autoremove packages (Ubuntu)
|
||||||
|
apt:
|
||||||
|
autoremove: true
|
||||||
|
purge: true
|
||||||
|
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Pop!_OS"
|
||||||
|
|
||||||
|
- 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"
|
||||||
|
|
||||||
|
- name: Upgraded packages (CentOS)
|
||||||
|
yum:
|
||||||
|
name: "*"
|
||||||
|
state: latest
|
||||||
|
when: ansible_distribution == "CentOS"
|
||||||
|
|
||||||
|
# EOF
|
Loading…
Reference in New Issue