26 lines
831 B
YAML
26 lines
831 B
YAML
---
|
|
- name: System update for all managed hosts
|
|
hosts: all
|
|
become: yes
|
|
gather_facts: yes # для получения информации о дистрибутиве
|
|
|
|
tasks:
|
|
- name: Update apt cache (Debian/Ubuntu)
|
|
apt:
|
|
update_cache: yes
|
|
cache_valid_time: 3600 # не обновлять кэш, если он свежее 1 часа
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- name: Perform dist-upgrade (full upgrade)
|
|
apt:
|
|
upgrade: dist
|
|
autoremove: yes
|
|
autoclean: yes
|
|
when: ansible_os_family == "Debian"
|
|
|
|
# - name: Reboot if required (optional)
|
|
# reboot:
|
|
# reboot_timeout: 600
|
|
# pre_reboot_delay: 30
|
|
# post_reboot_delay: 30
|
|
# when: ansible_os_family == "Debian" and ansible_distribution_version is version('10', '>=') |