debian: enable automatic upgrades only for virtual machines

And factor out VM stuff into a separate file.
This commit is contained in:
Timotej Lazar 2025-10-22 19:28:53 +02:00
parent 6a5ebfe5b5
commit 2f02f1eb2c
2 changed files with 15 additions and 13 deletions

12
roles/debian/tasks/vm.yml Normal file
View file

@ -0,0 +1,12 @@
- name: Install automatic upgrade package
package:
name: unattended-upgrades
- name: Configure automatic upgrades
lineinfile:
path: /etc/apt/apt.conf.d/20auto-upgrades
create: yes
line: '{{ item }}'
loop:
- 'APT::Periodic::Update-Package-Lists "1";'
- 'APT::Periodic::Unattended-Upgrade "1";'