Compare commits
2 Commits
43c2aa7ad5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 978e1fbf93 | |||
| dea2d746f7 |
@@ -7,38 +7,26 @@
|
||||
hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
- name: Update package cache for Debian-based systems
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Upgrade all packages for Debian-based systems
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
upgrade: dist
|
||||
autoremove: true
|
||||
autoclean: true
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Update package cache for RedHat-based systems (dnf)
|
||||
ansible.builtin.dnf:
|
||||
update_cache: true
|
||||
when: ansible_pkg_mgr == "dnf"
|
||||
|
||||
- name: Upgrade all packages for RedHat-based systems (dnf)
|
||||
ansible.builtin.dnf:
|
||||
name: "*"
|
||||
state: latest # noqa package-latest
|
||||
when: ansible_pkg_mgr == "dnf"
|
||||
|
||||
- name: Update package cache for RedHat-based systems (yum)
|
||||
ansible.builtin.yum:
|
||||
update_cache: true
|
||||
when: ansible_pkg_mgr == "yum"
|
||||
when: ansible_pkg_mgr == "dnf"
|
||||
|
||||
- name: Upgrade all packages for RedHat-based systems (yum)
|
||||
ansible.builtin.yum:
|
||||
name: "*"
|
||||
state: latest # noqa package-latest
|
||||
update_cache: true
|
||||
when: ansible_pkg_mgr == "yum"
|
||||
|
||||
# End of playbook
|
||||
|
||||
@@ -20,5 +20,5 @@
|
||||
ansible.windows.win_updates:
|
||||
category_names: "{{ update_categories }}"
|
||||
state: installed
|
||||
reboot: true
|
||||
reboot: false
|
||||
# Runs with elevated privileges via WinRM connection
|
||||
|
||||
Reference in New Issue
Block a user