alpine: configure unattended upgrades

This commit is contained in:
Timotej Lazar 2024-06-17 09:52:56 +02:00
parent 6a9a4142ce
commit 393614aa79
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,8 @@
#!/bin/sh
upgrade() {
echo "Starting upgrade on $(date)"
apk upgrade --update
}
upgrade >> /var/log/unattended-upgrade.log

View file

@ -0,0 +1,3 @@
/var/log/unattended-upgrade.log {
missingok
}

View file

@ -22,6 +22,7 @@
name:
- git
- iproute2
- logrotate
- nftables
- procps
- rsync
@ -64,3 +65,15 @@
name: qemu-guest-agent
enabled: yes
state: started
- name: Install automatic upgrade script
copy:
dest: /etc/periodic/weekly/
src: unattended-upgrade
mode: 0755
- name: Configure log rotation for automatic upgrades
copy:
dest: /etc/logrotate.d/unattended-upgrade
src: unattended-upgrade.logrotate
mode: 0644