Skip to content

Commit 8b4dbbf

Browse files
authored
Merge pull request #740 from rust-lang/enable-unattended-upgrades-in-dev-desktops
ensure unattended-upgrades is enabled
2 parents 16e70cc + 7b4afff commit 8b4dbbf

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

ansible/roles/common/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,37 @@ want to preserve.
5858
# If the URL is missing logs will not be shipped to Papertrail.
5959
papertrail_url: logsN.papertrailapp.com:NNNNN
6060
```
61+
62+
## Unattended Upgrades
63+
64+
Unattended-upgrades is a package that allows automatic installation of security updates on Debian-based systems.
65+
The `unattended-upgrades.yml` task configures unattended-upgrades to ensure that security updates are applied automatically.
66+
67+
This service is enabled by default on Ubuntu, but the task ensures it wasn't
68+
disabled.
69+
70+
### Monitoring
71+
72+
Log files:
73+
74+
- `/var/log/dpkg.log`
75+
- `/var/log/unattended-upgrades/`
76+
77+
Check the status of unattended-upgrades with:
78+
79+
```bash
80+
sudo systemctl status unattended-upgrades
81+
```
82+
83+
### Tips
84+
85+
To test the outcome of unattended-upgrades without making any changes, you can run the following command:
86+
87+
```bash
88+
sudo unattended-upgrades --dry-run --debug
89+
```
90+
91+
### Docs
92+
93+
- [Ubuntu help](https://help.ubuntu.com/community/AutomaticSecurityUpdates)
94+
- [Debian wiki](https://wiki.debian.org/UnattendedUpgrades)

ansible/roles/common/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
- include_tasks: papertrail.yml
1010
- include_tasks: cleanup.yml
1111
- include_tasks: services.yml
12+
- include_tasks: unattended-upgrades.yml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
3+
# The default configuration of unattended-upgrades is to install security updates only.
4+
- name: install the unattended-upgrades package
5+
apt:
6+
name: unattended-upgrades
7+
state: present
8+
9+
- name: ensure unattended-upgrades is running and enabled
10+
service:
11+
name: unattended-upgrades
12+
state: started
13+
enabled: yes

0 commit comments

Comments
 (0)