alpine: configure unattended upgrades
This commit is contained in:
parent
6a9a4142ce
commit
393614aa79
8
roles/alpine/files/unattended-upgrade
Normal file
8
roles/alpine/files/unattended-upgrade
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
upgrade() {
|
||||
echo "Starting upgrade on $(date)"
|
||||
apk upgrade --update
|
||||
}
|
||||
|
||||
upgrade >> /var/log/unattended-upgrade.log
|
3
roles/alpine/files/unattended-upgrade.logrotate
Normal file
3
roles/alpine/files/unattended-upgrade.logrotate
Normal file
|
@ -0,0 +1,3 @@
|
|||
/var/log/unattended-upgrade.log {
|
||||
missingok
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue