From 4345fd69b41114e2e9ffa12772a78acca7083bff Mon Sep 17 00:00:00 2001 From: Christoph Sieber Date: Wed, 14 Jan 2026 11:37:22 +0100 Subject: [PATCH 1/2] fix: reorder tasks in main.yml fixes the order of the tasks in the main.yml. If the current repo configuration of the system is invalid the playbook fails in the "update" step of the install.yml part and is unable to setup the repository correctly because this step would only be executed later on in the "manage.yml" task. Changing the order here ensures that the repositories are setup correctly before trying to update the package list or installing any packages from them. --- tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index be5a7eb..a53959a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,16 +7,16 @@ - config - apt-config -- import_tasks: install.yml +- import_tasks: manage.yml tags: - system - apt - - install - - apt-install + - manage + - apt-manage -- import_tasks: manage.yml +- import_tasks: install.yml tags: - system - apt - - manage - - apt-manage + - install + - apt-install From 8a019d9678a4e2bbae89e4370d768f3b7deef132 Mon Sep 17 00:00:00 2001 From: Christoph Sieber Date: Wed, 14 Jan 2026 13:17:25 +0100 Subject: [PATCH 2/2] allow "update_url" setting in repo config this allows updating the repository url instead of adding a new version of the repo with the updated url --- tasks/repositories.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/repositories.yml b/tasks/repositories.yml index bd14ca7..3c4abdb 100644 --- a/tasks/repositories.yml +++ b/tasks/repositories.yml @@ -1,7 +1,16 @@ --- +- name: Remove managed repo files before adding repo to allow updating URLs + when: + - item.update_url is defined + - item.filename is defined + - item.update_url + ansible.builtin.file: + path: "/etc/apt/sources.list.d/{{ item.filename }}.list" + state: absent + loop: "{{ apt_repositories }}" - name: Adding apt repository - apt_repository: + ansible.builtin.apt_repository: codename: "{{ item.codename | default(omit) }}" filename: "{{ item.filename | default(omit) }}" mode: "{{ item.mode | default(omit) }}"