From 5f94e06b1b301e66d3fa5faf7a7de02bad7ffd71 Mon Sep 17 00:00:00 2001 From: administrator Date: Thu, 20 Aug 2026 00:26:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20playbooks/update.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playbooks/update.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 playbooks/update.yml diff --git a/playbooks/update.yml b/playbooks/update.yml new file mode 100644 index 0000000..c644cea --- /dev/null +++ b/playbooks/update.yml @@ -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', '>=') \ No newline at end of file