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