2
0
This commit is contained in:
2024-06-06 18:47:45 +02:00
parent 9f676662c4
commit 8815c2027d
2 changed files with 10 additions and 11 deletions

View File

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