alphagov/govuk_offsitebackups-puppet — pull request #72 by mattbostock (2014-09-29 15:45:36+00:00)
Title: [#73607174] Enable automatic reboot after unattended-upgrades

...so that we don't need to manually reboot the machine after critical security updates are applied.

Install the `update-notifier-common` package as it's required for the automatic reboots to work. `update-notifier-common` is responsible for creating the `/var/run/reboot-required` file.

Note that the schedule for reboots and related cron jobs is as follows (all times in UTC):

- [Transition CDN logs][cdn_logs] are backed up at 22:10
- the [asset backup jobs][asset_backup] happen at 04:13 and 04:20
- unattended-upgrades on this box runs (and potentially could cause an immediate reboot) at 06:25 (as defined by Ubuntu's cron.daily)
- the offsite backups from the main GOV.UK stack occur at 08:13

It's the last backup that we care about most and reboots should be infrequent; I don't foresee any major conflicts as the assets should back up relatively quickly (they are using `librsync` deltas provided by
[duplicity]).

Tested in Vagrant using:

```bash
vagrant@obnode0:/etc/apt/apt.conf.d$ sudo touch /var/run/reboot-required
vagrant@obnode0:/etc/apt/apt.conf.d$ sudo unattended-upgrade

Broadcast message from root@obnode0
(unknown) at 15:35 ...

The system is going down for reboot NOW!
vagrant@obnode0:/etc/apt/apt.conf.d$ Connection to 127.0.0.1 closed by remote host.
Connection to 127.0.0.1 closed.
```

[asset_backup]: https://github.gds/gds/puppet/blob/fa551c6e88bc7416e481960919031c2cca7806a4/modules/backup/manifests/assets.pp#L61-L71
[cdn_logs]: https://github.com/alphagov/ci-puppet/blob/969ac59016ef41261572f1862e8c542e06f3b6af/modules/cdn_logs/manifests/backup.pp#L11-L12
[duplicity]: http://duplicity.nongnu.org/
[offsite_backup]: https://github.gds/gds/puppet/blob/a74e16da55bbcb2737957edad44718d5841bd896/modules/backup/manifests/offsite.pp#L30-L31