add update-linux.yml

This commit is contained in:
djorgensen 2024-08-16 13:08:15 -06:00
parent e390440dfc
commit 15d8ebcf95

27
update/update-linux.yml Normal file
View File

@ -0,0 +1,27 @@
---
- name: Update and upgrade apt packages
hosts: all
become: true
tasks:
- name: Update packages with apt
when: ansible_pkg_mgr == 'apt'
apt:
update_cache: yes
- name: Update packages with yum
when: ansible_pkg_mgr == 'yum'
yum:
name: '*'
state: latest
- name: Upgrade packages with apt
when: ansible_pkg_mgr == 'apt'
apt:
upgrade: dist
- name: Upgrade packages with yum
when: ansible_pkg_mgr == 'yum'
yum:
name: '*'
state: latest
exclude: kernel*