This commit is contained in:
2026-07-12 08:44:40 +02:00
commit 55991dcb4e
21 changed files with 610 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
// Zarządzane przez Ansible (playbook_security_baseline.yml) — nie edytuj ręcznie.
// Instaluje wyłącznie aktualizacje bezpieczeństwa, bez automatycznego restartu:
// decyzję o reboot podejmuje operator na podstawie playbook_fleet_report.yml.
Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
"origin=Ubuntu,archive=${distro_codename}-security";
};
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "false";
Unattended-Upgrade::Automatic-Reboot-WithUsers "false";

33
templates/fleet_report.j2 Normal file
View File

@@ -0,0 +1,33 @@
Raport stanu floty — {{ ansible_date_time.iso8601 }}
{{ '=' * 60 }}
{% set reported_hosts = hostvars | dict2items | selectattr('value.host_report', 'defined') | map(attribute='key') | sort %}
{% set reboot_hosts = [] %}
{% for h in reported_hosts %}
{% if hostvars[h].host_report.reboot_required %}
{% set _ = reboot_hosts.append(h) %}
{% endif %}
{% endfor %}
Hosty ({{ reported_hosts | length }}):
{% for h in reported_hosts %}
{% set r = hostvars[h].host_report %}
- {{ h }}
OS: {{ r.os }}
Uptime: {{ r.uptime_days }} dni
Dysk / zajęty: {{ r.disk_root_percent }}%
Aktualizacje: {{ r.upgradable_packages }} oczekujących
Reboot wymagany: {{ 'TAK' if r.reboot_required else 'nie' }}
{% endfor %}
{{ '=' * 60 }}
{% if reboot_hosts | length > 0 %}
UWAGA — hosty wymagające ręcznego restartu ({{ reboot_hosts | length }}):
{% for h in reboot_hosts %}
- {{ h }}
{% endfor %}
Reboot NIE jest wykonywany automatycznie — zrestartuj te hosty ręcznie,
gdy będzie to bezpieczne (patrz grupy Type-HOST / Type-VM / Type-CT).
{% else %}
Żaden host nie wymaga restartu.
{% endif %}