Update ansible/update.yml

This commit is contained in:
2026-08-11 22:23:48 +02:00
parent cf0eabd109
commit 98962e288a

View File

@@ -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' }}"