2
0
Files
Ansible/Update/upd-apt.yaml
2024-06-06 18:47:45 +02:00

28 lines
689 B
YAML

---
- name: Update and upgrade apt packages
hosts: all
become: yes
become_method: sudo
tasks:
- name: Update packages with apt
when: ansible_pkg_mgr == 'apt'
apt:
update_cache: true
- name: Upgrade packages with apt
when: ansible_pkg_mgr == 'apt'
command: sudo apt-get upgrade -y
- name: Update packages with yum
when: ansible_pkg_mgr == 'yum'
ansible.builtin.yum:
name: '*'
state: latest # noqa: package-latest
- name: Upgrade packages with yum
when: ansible_pkg_mgr == 'yum'
ansible.builtin.yum:
name: '*'
state: latest # noqa: package-latest
exclude: kernel*