From 7b2b1b832944024d12b384a4a2d969cf693b414a Mon Sep 17 00:00:00 2001 From: Julien Riou Date: Sat, 27 Apr 2024 17:25:39 +0200 Subject: [PATCH] feat(apt): Use distribution name Signed-off-by: Julien Riou --- files/apt/raspi.list | 3 --- tasks/apt.yml | 4 ++-- templates/apt/raspi.list.j2 | 4 ++++ 3 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 files/apt/raspi.list create mode 100644 templates/apt/raspi.list.j2 diff --git a/files/apt/raspi.list b/files/apt/raspi.list deleted file mode 100644 index 4ef8d00..0000000 --- a/files/apt/raspi.list +++ /dev/null @@ -1,3 +0,0 @@ -# Managed by Ansible -deb http://mirror.unix-solutions.be/raspbian/raspbian/ buster main -deb http://mirror.nl.leaseweb.net/raspbian/raspbian/ buster main diff --git a/tasks/apt.yml b/tasks/apt.yml index 6a1df3b..0ca4e58 100644 --- a/tasks/apt.yml +++ b/tasks/apt.yml @@ -7,8 +7,8 @@ state: absent - name: Define repositories - ansible.builtin.copy: - src: files/apt/raspi.list + ansible.builtin.template: + src: apt/raspi.list.j2 dest: /etc/apt/sources.list.d/raspi.list - name: Update system diff --git a/templates/apt/raspi.list.j2 b/templates/apt/raspi.list.j2 new file mode 100644 index 0000000..3d2f386 --- /dev/null +++ b/templates/apt/raspi.list.j2 @@ -0,0 +1,4 @@ +{{ ansible_managed | comment }} + +deb http://mirror.unix-solutions.be/raspbian/raspbian/ {{ ansible_distribution_release }} main +deb http://mirror.nl.leaseweb.net/raspbian/raspbian/ {{ ansible_distribution_release }} main