Skip to content

Instantly share code, notes, and snippets.

@DevopsVlogger
Created September 28, 2020 11:46
Show Gist options
  • Save DevopsVlogger/6bdbeed1c0bc8aa2337e226cac719353 to your computer and use it in GitHub Desktop.
Save DevopsVlogger/6bdbeed1c0bc8aa2337e226cac719353 to your computer and use it in GitHub Desktop.
Ansible Playbook to perform old Kernel removal on RHEL/CentOS Server
---
#### Ansible Playbook to perform old Kernel removal on RHEL/CentOS Server ####
tasks:
- name: Ensure the latest yum-utils package is available on the server
yum:
name: yum-utils
state: latest
- name: remove the old kernels from the system
shell: package-cleanup --oldkernels --count=2 -y
ignore_errors: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment