From 98962e288ae319f0d0ad4f6ef55cb13ce54ea270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20=C5=BBbikowski?= Date: Tue, 11 Aug 2026 22:23:48 +0200 Subject: [PATCH] Update ansible/update.yml --- ansible/update.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ansible/update.yml b/ansible/update.yml index cce3ad9..617f27d 100644 --- a/ansible/update.yml +++ b/ansible/update.yml @@ -37,16 +37,19 @@ # ========================================== - name: Zbieranie faktów systemowych ansible.builtin.setup: - when: host_is_online + when: host_is_online | default(false) + ignore_unreachable: true + ignore_errors: true # ========================================== # DEBIAN / UBUNTU # ========================================== - name: Aktualizacja pakietów (Debian/Ubuntu) when: - - host_is_online + - host_is_online | default(false) - ansible_os_family | default('') == 'Debian' - not (skip_apt | default(false)) + ignore_unreachable: true block: - name: Aktualizacja pamięci podręcznej i podniesienie pakietów ansible.builtin.apt: @@ -69,9 +72,10 @@ # ========================================== - name: Aktualizacja pakietów (Alpine Linux) when: - - host_is_online + - host_is_online | default(false) - ansible_os_family | default('') == 'Alpine' - not (skip_apt | default(false)) + ignore_unreachable: true block: - name: Aktualizacja pamięci podręcznej i pakietów (apk) community.general.apk: @@ -102,5 +106,5 @@ ansible.builtin.debug: msg: - "Host: {{ inventory_hostname }} ({{ ansible_distribution | default('Brak połączenia') }})" - - "Status: {{ '🔴 NIEOSIĄGALNY / WYŁĄCZONY' if not host_is_online else ('⏭️ POMINIĘTO (skip_apt)' if (skip_apt | default(false)) else '✅ ZAKOŃCZONO SUCCESS') }}" + - "Status: {{ '🔴 NIEOSIĄGALNY / WYŁĄCZONY' if not (host_is_online | default(false)) else ('⏭️ POMINIĘTO (skip_apt)' if (skip_apt | default(false)) else '✅ ZAKOŃCZONO SUCCESS') }}" - "Status restartu: {{ '⚠️ WYMAGANY RESTART!' if (reboot_needed | default(false)) else '✅ Brak potrzeby restartu' }}" \ No newline at end of file