fix(base_system): improve the system-wide upgrade
When upgrading packages to their latest version, decide which Ansible module to use based on the ‹pkg_mgr› Ansible fact instead of the distribution. This approach is more robust, and more correct, as the package managers are shared between some of the distributions. Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
a79bfb5551
commit
4ca89d7641
1 changed files with 3 additions and 3 deletions
|
@ -4,16 +4,16 @@
|
||||||
name: "*"
|
name: "*"
|
||||||
state: latest
|
state: latest
|
||||||
update_cache: true
|
update_cache: true
|
||||||
when: ansible_distribution in [ "Debian", "Ubuntu" ]
|
when: ansible_facts.pkg_mgr == "apt"
|
||||||
|
|
||||||
- name: Upgrade all packages with ‹dnf›
|
- name: Upgrade all packages with ‹dnf›
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: "*"
|
name: "*"
|
||||||
state: latest
|
state: latest
|
||||||
when: ansible_distribution in [ "AlmaLinux", "CentOS", "Fedora" ]
|
when: ansible_facts.pkg_mgr == "dnf"
|
||||||
|
|
||||||
- name: Upgrade all packages with ‹zypper›
|
- name: Upgrade all packages with ‹zypper›
|
||||||
community.general.zypper:
|
community.general.zypper:
|
||||||
name: "*"
|
name: "*"
|
||||||
state: latest
|
state: latest
|
||||||
when: "'openSUSE' in ansible_distribution"
|
when: ansible_facts.pkg_mgr == "zypper"
|
||||||
|
|
Loading…
Reference in a new issue