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