| Filename | Latest commit message | Latest commit date |
|---|---|---|
| defaults | ||
| meta | ||
| tasks | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
OS Update
Eine Ansible Role zum automatisierten Installieren von Betriebssystem-Updates auf Debian/Ubuntu, RHEL/CentOS/Alma/Rocky und SUSE Linux. Die Rolle unterscheidet zwischen vollständigen Updates und Sicherheitsupdates und prüft am Ende, ob ein Neustart erforderlich ist.
Funktionen
- Debian/Ubuntu:
apt-basierte Aktualisierung - Red Hat / CentOS / Rocky / Alma:
dnf-basierte Aktualisierung - SUSE / SLES:
zypper-basierte Aktualisierung - Auswahl zwischen
securityundall - Automatischer Neustart, falls erforderlich und erlaubt
- Reboot-Prüfung mit Betriebssystem-spezifischen Mechanismen
Voraussetzungen
- Ansible >= 2.10
- Zielsysteme mit unterstütztem Betriebssystem:
- Debian / Ubuntu
- RedHat basierte Systeme
- SUSE Linux Enterprise / openSUSE
- Root-Rechte oder sudo auf dem Zielsystem
Variablen
In defaults/main.yml sind die Standardwerte definiert:
---
# Optionen: 'security' oder 'all'
update_type: "security"
# Neustart standardmäßig AKTIV (kann zur Laufzeit überschrieben werden)
allow_reboot: true
update_type
security: installiert nur Sicherheitsupdatesall: aktualisiert alle Pakete auf die jeweils aktuelle Version
allow_reboot
true: erlaubt der Rolle einen Neustart, falls das System nach dem Update neu gestartet werden mussfalse: deaktiviert den Neustart auch dann, wenn ein Reboot erforderlich ist
Beispiel
- hosts: all
become: true
roles:
- role: os-update
vars:
update_type: "security"
allow_reboot: true
Beispiel mit vollständigem Update
- hosts: linux
become: true
tasks:
- name: OS-Updates durchführen
ansible.builtin.include_role:
name: os-update
vars:
update_type: "all"
allow_reboot: false
Ablauf der Rolle
- Ermittlung des Betriebssystems via
ansible_os_family - Ausführen des passenden Tasks für Debian, RedHat oder SUSE
- Prüfung, ob ein Neustart erforderlich ist
- Optionaler Neustart mit
ansible.builtin.reboot
Unterstützte Betriebssystemfamilien
- Debian
- RedHat
- Suse
Lizenz
Diese Rolle steht unter der MIT-Lizenz. Siehe die Datei LICENSE für den vollständigen Text.
MIT License
Copyright (c) 2026
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.