From 1d5cd9370ae2e14a12315e3d4d285938ccfe6200 Mon Sep 17 00:00:00 2001 From: MeinholC Date: Tue, 14 Apr 2026 19:37:08 +0200 Subject: [PATCH] =?UTF-8?q?update.yml=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 update.yml diff --git a/update.yml b/update.yml new file mode 100644 index 0000000..cd298dc --- /dev/null +++ b/update.yml @@ -0,0 +1,24 @@ +--- +- 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 \ No newline at end of file