Добавить playbooks/update.yml

This commit is contained in:
2026-08-20 00:26:59 +03:00
parent d8a4b1331e
commit 5f94e06b1b
+26
View File
@@ -0,0 +1,26 @@
---
- 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', '>=')