Infra_mgmt/roles/unattended-upgrades/tasks/unattended-upgrades.yml

26 lines
610 B
YAML
Raw Normal View History

2023-05-07 12:01:52 +02:00
- 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"