summaryrefslogtreecommitdiffstats
path: root/tasks/apt.yml
blob: 10239084a4b1ea664c61a1d710270dddd147a543 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- name: Install various APT tools (1)
  apt: pkg={{ packages }}
  vars:
    packages:
    - apt
    - lsb-release

- name: Remove /etc/apt/sources.list
  file: path=/etc/apt/sources.list state=absent
  notify:
    - apt-get update

- name: Remove /etc/apt/sources.list.d/hetzner-*
  file: path={{ item }} state=absent
  with_fileglob: /etc/apt/sources.list.d/hetzner-*
  notify:
    - apt-get update

- name: Copy /etc/apt/sources.list.d/debian.sources
  template: src=etc/apt/sources.list.d/debian.sources.j2
            dest=/etc/apt/sources.list.d/debian.sources
            owner=root group=root
            mode=0644
  notify:
    - apt-get update

- name: Remove /etc/apt/apt.conf.d/*hetzner
  file: path={{ item }} state=absent
  with_fileglob: /etc/apt/apt.conf.d/*hetzner

# We should run 'apt-get update' before proceeding to any other task.
- meta: flush_handlers

- name: Install various APT tools (2)
  apt: pkg={{ packages }}
  vars:
    packages:
    - apt-listchanges
    - needrestart
    - unattended-upgrades

- name: Configure apt-listchanges
  copy: src=etc/apt/listchanges.conf
        dest=/etc/apt/listchanges.conf
        owner=root group=root
        mode=0644