ansible-roles/apt/tasks/backports.oneline.yml

46 lines
1.1 KiB
YAML
Raw Normal View History

2017-01-10 10:18:42 +01:00
---
2017-06-07 09:53:42 +02:00
- name: No backports config in default sources.list
ansible.builtin.lineinfile:
dest: /etc/apt/sources.list
regexp: "backports"
state: absent
tags:
2019-06-21 10:18:54 +02:00
- apt
2017-01-10 10:18:42 +01:00
- name: Backports sources list is installed
ansible.builtin.template:
src: '{{ ansible_distribution_release }}_backports.list.j2'
2017-01-10 10:18:42 +01:00
dest: /etc/apt/sources.list.d/backports.list
force: yes
mode: "0640"
register: apt_backports_list
tags:
2019-06-21 10:18:54 +02:00
- apt
2017-01-10 10:18:42 +01:00
- name: Backports configuration
ansible.builtin.copy:
src: '{{ ansible_distribution_release }}_backports_preferences'
dest: /etc/apt/preferences.d/0-backports-defaults
2017-01-10 10:18:42 +01:00
force: yes
mode: "0640"
register: apt_backports_config
tags:
2019-06-21 10:18:54 +02:00
- apt
2019-04-16 16:30:05 +02:00
- name: Archived backport are accepted (jessie)
ansible.builtin.lineinfile:
dest: '/etc/apt/apt.conf.d/99no-check-valid-until'
line: 'Acquire::Check-Valid-Until no;'
create: yes
state: present
2019-06-21 10:18:54 +02:00
tags:
- apt
2023-03-17 20:05:42 +01:00
when: ansible_distribution_release == "jessie"
- name: Apt update
ansible.builtin.apt:
update_cache: yes
tags:
2019-06-21 10:18:54 +02:00
- apt
2023-03-17 20:05:42 +01:00
when: apt_backports_list is changed or apt_backports_config is changed