templier-ansible/roles/apt/tasks/main.yml

43 lines
1013 B
YAML
Raw Normal View History

---
- name: Add mirror.crans.org in /etc/hosts
lineinfile:
state: present
path: /etc/hosts
regex: "^{{ item }}"
line: "{{ item }} mirror.crans.org charybde.crans.org mirror"
loop:
- "185.230.79.30"
- "2a0c:700:2:0:ea39:35ff:fef0:48c9"
- name: Configure Debian repositories
template:
src: apt/sources.list.j2
dest: /etc/apt/sources.list
owner: root
group: root
mode: 0644
- name: Connfigure extra repositories
template:
src: apt/sources.list.d/sources.list.j2
dest: "/etc/apt/sources.list.d/{{ item.name }}.list"
owner: root
group: root
mode: 0644
loop: "{{ apt.extra_repositories }}"
- name: Configure pin from future distributions
template:
src: "apt/{{ item[0] }}.d/pin.list.j2"
dest: "/etc/apt/{{ item[0] }}.d/{{ item[1].key }}.list"
owner: root
group: root
mode: 0644
with_nested:
- ["sources.list", "preferences"]
- "{{ apt.pin|dict2items }}"
- name: Update APT cache
apt:
update_cache: true