[apt] Pin some packages from other versions

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-04-08 00:28:20 +02:00
parent 7388125008
commit 4814d7d6ae
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
4 changed files with 28 additions and 0 deletions

View File

@ -2,3 +2,5 @@
glob_apt:
mirror: "http://mirror.crans.org/"
extra_repositories: []
pin:
bullseye: []

View File

@ -25,3 +25,14 @@
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 }}"

View File

@ -0,0 +1,12 @@
{{ ansible_header | comment }}
Package: *
Pin: release n={{ item[1].key }}
Pin-Priority: 1
{% for package in item[1].value -%}
Package: {{ package }}
Pin: release n={{ item[1].key }}
Pin-Priority: 900
{% endfor -%}

View File

@ -0,0 +1,3 @@
{{ ansible_header | comment }}
deb {{ apt.mirror }}debian {{ item[1].key }} main contrib non-free