From 44eff3e63c9b8afeb87e72ff462ab6714eafc472 Mon Sep 17 00:00:00 2001 From: Gian Klug Date: Thu, 3 Oct 2024 13:57:03 +0200 Subject: [PATCH] fix(debian): remove old apt repository first --- tasks/installation.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tasks/installation.yml b/tasks/installation.yml index 0bb9a01..f38c9f8 100644 --- a/tasks/installation.yml +++ b/tasks/installation.yml @@ -1,4 +1,13 @@ --- +- name: Remove old icinga apt repository without key + ansible.builtin.apt_repository: + repo: "deb http://packages.icinga.com/{{ ansible_distribution | lower }} icinga-{{ ansible_distribution_release }} main" + state: absent + when: + - ansible_os_family == 'Debian' + - (ansible_lsb.id != 'Univention' or ansible_distribution_release != 'stretch') + notify: Update package repository + - name: Install dependencies for debian-based distributions ansible.builtin.apt: name: " {{ item }}" @@ -46,15 +55,6 @@ state: present when: ansible_os_family == 'Debian' -- name: Remove old icinga apt repository without key - ansible.builtin.apt_repository: - repo: "deb http://packages.icinga.com/{{ ansible_distribution | lower }} icinga-{{ ansible_distribution_release }} main" - state: absent - when: - - ansible_os_family == 'Debian' - - (ansible_lsb.id != 'Univention' or ansible_distribution_release != 'stretch') - notify: Update package repository - - name: Configure icinga apt repository ansible.builtin.apt_repository: repo: "{{ icinga2_agent_apt.repo }}"