Force updated caches for OS patching. Just because it works without it for Fedora, doesn't mean that was safe for Debian based OS or even some EL based OS.

This commit is contained in:
2026-08-02 23:36:10 -05:00
parent 44ccab8f9b
commit cbd79156f1
+16 -3
View File
@@ -51,17 +51,30 @@
ansible.builtin.apt: ansible.builtin.apt:
autoclean: 'yes' autoclean: 'yes'
autoremove: 'yes' autoremove: 'yes'
update_cache: 'yes'
upgrade: 'dist' upgrade: 'dist'
notify: notify:
- 'ensure_os_patch.package_facts' - 'ensure_os_patch.package_facts'
- 'ensure_os_patch.service_facts' - 'ensure_os_patch.service_facts'
- name: 'ensure dnf or yum patch' - name: 'ensure dnf'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["pkg_mgr"] == 'dnf' or ansible_facts["pkg_mgr"] == 'dnf5' or ansible_facts["pkg_mgr"] == 'yum' - ansible_facts["pkg_mgr"] == 'dnf'
ansible.builtin.package: ansible.builtin.dnf:
name: '*' name: '*'
state: 'latest' state: 'latest'
update_cache: 'yes'
notify:
- 'ensure_os_patch.package_facts'
- 'ensure_os_patch.service_facts'
- name: 'ensure dnf5'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["pkg_mgr"] == 'dnf5'
ansible.builtin.dnf5:
name: '*'
state: 'latest'
update_cache: 'yes'
notify: notify:
- 'ensure_os_patch.package_facts' - 'ensure_os_patch.package_facts'
- 'ensure_os_patch.service_facts' - 'ensure_os_patch.service_facts'