main.yml (423B)
1 --- 2 - name: Update apt cache and upgrade packages 3 ansible.builtin.apt: 4 update_cache: true 5 upgrade: full 6 autoremove: true 7 autoclean: true 8 9 - name: Check if reboot is required 10 ansible.builtin.stat: 11 path: /var/run/reboot-required 12 register: reboot_required 13 14 - name: Notify if reboot is required 15 ansible.builtin.debug: 16 msg: "Reboot required to apply updates." 17 when: reboot_required.stat.exists