aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/apt/tasks/unattended_upgrades.yml
blob: 7bcc1247a382897b48b60f0582b39f0a4b223983 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
- name: Install unattended-upgrades
  become: true
  ansible.builtin.apt:
    name: unattended-upgrades
    state: present

- name: Configure 50unattended-upgrades
  become: true
  ansible.builtin.template:
    src: 50unattended-upgrades.j2
    dest: /etc/apt/apt.conf.d/50unattended-upgrades
    owner: root
    group: root
    mode: '644'

# https://wiki.debian.org/UnattendedUpgrades says that 20auto-upgrades and
# 02periodic are _alternatives_ (and, presumably, not mechanisms that can be
# used together).
- name: Configure 20auto-upgrades
  become: true
  ansible.builtin.file:
    path: /etc/apt/apt.conf.d/20auto-upgrades
    state: absent

- name: Configure 02periodic
  become: true
  ansible.builtin.template:
    src: 02periodic.j2
    dest: /etc/apt/apt.conf.d/02periodic
    owner: root
    group: root
    mode: '644'