2
0

added become-method

This commit is contained in:
2024-06-06 18:01:51 +02:00
parent 724a7c67cd
commit bb9472399d

View File

@@ -7,18 +7,21 @@
- name: Update packages with apt
when: ansible_pkg_mgr == 'apt'
become: true
become_method: sudo
ansible.builtin.apt:
update_cache: true
- name: Upgrade packages with apt
when: ansible_pkg_mgr == 'apt'
become: true
become_method: sudo
ansible.builtin.apt:
upgrade: dist
- name: Update packages with yum
when: ansible_pkg_mgr == 'yum'
become: true
become_method: sudo
ansible.builtin.yum:
name: '*'
state: latest # noqa: package-latest
@@ -26,6 +29,7 @@
- name: Upgrade packages with yum
when: ansible_pkg_mgr == 'yum'
become: true
become_method: sudo
ansible.builtin.yum:
name: '*'
state: latest # noqa: package-latest