Skip to content

Commit

Permalink
Split up unattended upgrades (trailofbits#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackivanov authored and Yuhui Huang committed Oct 23, 2018
1 parent a2dcea6 commit 764171d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
3 changes: 0 additions & 3 deletions roles/common/templates/50unattended-upgrades.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
"${distro_id}:${distro_codename}-updates";
{% if wireguard_enabled %}
"LP-PPA-wireguard-wireguard:${distro_codename}";
{% endif %}
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
"LP-PPA-shevchuk-dnscrypt-proxy:${distro_codename}";
};
10 changes: 9 additions & 1 deletion roles/dns_encryption/tasks/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
until: result|succeeded
retries: 10
delay: 3

- name: Install dnscrypt-proxy
apt:
name: dnscrypt-proxy
state: latest
update_cache: true

- name: Configure unattended-upgrades
copy:
src: 50-dnscrypt-proxy-unattended-upgrades
dest: /etc/apt/apt.conf.d/50-dnscrypt-proxy-unattended-upgrades
owner: root
group: root
mode: 0644

- block:
- name: Ubuntu | Unbound profile for apparmor configured
copy:
Expand Down
4 changes: 4 additions & 0 deletions roles/wireguard/files/50-wireguard-unattended-upgrades
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
"LP-PPA-wireguard-wireguard:${distro_codename}";
};
8 changes: 8 additions & 0 deletions roles/wireguard/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
state: present
update_cache: true

- name: Configure unattended-upgrades
copy:
src: 50-wireguard-unattended-upgrades
dest: /etc/apt/apt.conf.d/50-wireguard-unattended-upgrades
owner: root
group: root
mode: 0644

- name: Ensure the required directories exist
file:
dest: "{{ wireguard_config_path }}/{{ item }}"
Expand Down

0 comments on commit 764171d

Please sign in to comment.