summaryrefslogtreecommitdiff
path: root/roles/apt-repo/base/tasks/main.yml
blob: 27050b403d368c871f7f53576ba1c1d00fda78ed (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
33
34
35
36
37
38
39
40
41
---
- name: install global sources.list
  template:
    src: "{{ ansible_lsb.id | default(ansible_distribution) }}.list.j2"
    dest: /etc/apt/sources.list
  register: apt_repo_base_sources

- name: remove new-style ubuntu apt source entries
  loop:
  - ubuntu.sources
  - ubuntu.sources.curtin.orig
  file:
    path: "/etc/apt/sources.list.d/{{ item }}"
    state: absent

- name: remove seperate raspi.list file (repo is part of the base config)
  file:
    path: "/etc/apt/sources.list.d/raspi.list"
    state: absent

- name: update apt cache
  when: apt_repo_base_sources is changed
  command: apt-get update

- name: create keyring directory for external repos
  file:
    path: /etc/apt/keyrings
    state: directory

## aptitude is needed for package upgrade roles
- name: install aptitude
  apt:
    name: aptitude
    state: present

- name: get rid of ubuntu esm ads
  when:
  - ansible_distribution == "Ubuntu"
  file:
    path: /etc/apt/apt.conf.d/20apt-esm-hook.conf
    state: absent