Ansible/update.yml
2026-04-14 19:37:08 +02:00

24 lines
598 B
YAML

---
- name: Update and reboot servers
hosts: Server
become: true
gather_facts: true
tasks:
- name: Run apt update
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 3600
- name: Run apt upgrade (nur normale Updates)
ansible.builtin.apt:
upgrade: yes
- name: Run apt full-upgrade (inkl. Kernel, Abhängigkeiten)
ansible.builtin.apt:
upgrade: dist
- name: Reboot the server if needed
ansible.builtin.reboot:
msg: "Reboot initiated by Ansible after full-upgrade"
reboot_timeout: 600