Add unattended upgrades
Enable unattended upgrades and triggers unattended reboots (23:55 after an upgrade which needs reboot). Attention: this is specific to debian-style linux systems (Debian, Ubuntu,...).
This commit is contained in:
parent
139ba7504a
commit
fcad5b9354
2 changed files with 35 additions and 0 deletions
2
roles/unattended-upgrades/files/20auto-upgrades
Normal file
2
roles/unattended-upgrades/files/20auto-upgrades
Normal file
|
@ -0,0 +1,2 @@
|
|||
APT::Periodic::Update-Package-Lists "1";
|
||||
APT::Periodic::Unattended-Upgrade "1";
|
33
roles/unattended-upgrades/tasks/main.json
Normal file
33
roles/unattended-upgrades/tasks/main.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
[
|
||||
{
|
||||
"name": "Allow unattended reboots (1)",
|
||||
"lineinfile": {
|
||||
"dest": "/etc/apt/apt.conf.d/50unattended-upgrades",
|
||||
"regexp": "^(//)?Unattended-Upgrade::Automatic-Reboot ",
|
||||
"line": "Unattended-Upgrade::Automatic-Reboot \"true\";"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Allow unattended reboots (2)",
|
||||
"lineinfile": {
|
||||
"dest": "/etc/apt/apt.conf.d/50unattended-upgrades",
|
||||
"regexp": "^(//)?Unattended-Upgrade::Automatic-Reboot-Time ",
|
||||
"line": "Unattended-Upgrade::Automatic-Reboot-Time \"23:55\";"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Allow more origins for updates",
|
||||
"lineinfile": {
|
||||
"dest": "/etc/apt/apt.conf.d/50unattended-upgrades",
|
||||
"regexp": "^(//\\s*)?\"\\$\\{distro_id\\}:\\$\\{distro_codename\\}-updates\";",
|
||||
"line": "\"${distro_id}:${distro_codename}-updates\";"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Enable unattended upgrades",
|
||||
"copy": {
|
||||
"src": "20auto-upgrades",
|
||||
"dest": "/etc/apt/apt.conf.d/20auto-upgrades"
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Add table
Reference in a new issue