- name: Install unattended-upgrades package apt: name: unattended-upgrades state: present - name: Setup unattended-upgrades config template: src: unattended-upgrades.j2 dest: /etc/apt/apt.conf.d/52unattended-upgrades backup: true notify: restart_unattended-upgrades - name: Setup reboot notifier script template: src: reboot_alert.sh.j2 dest: /usr/local/sbin/reboot_alert.sh backup: true mode: +x - name: Setup cron to launch notifier script cron: name: "alert if reboot is required" minute: "0" hour: "8" job: "/usr/local/sbin/reboot_alert.sh"