From 6abc58229f057a63e1799c834538d5fb139c6e22 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 10 May 2024 00:19:23 +0200 Subject: migrate all os release comparisons to use new filter --- roles/core/base/tasks/Debian.yml | 3 ++- roles/core/cpu-microcode/tasks/Debian.yml | 2 +- roles/core/ntp/tasks/Debian_systemd-timesyncd.yml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'roles/core') diff --git a/roles/core/base/tasks/Debian.yml b/roles/core/base/tasks/Debian.yml index a735bcc7..4d2abc17 100644 --- a/roles/core/base/tasks/Debian.yml +++ b/roles/core/base/tasks/Debian.yml @@ -48,7 +48,8 @@ ## TODO: install dool on newer systems... or all of them. From which package source?? - name: install dstat for older systems only - when: (ansible_distribution == 'Debian' and (ansible_distribution_release | debian_release_compare('<=', 'bookworm'))) or (ansible_distribution == 'Ubuntu' and (ansible_distribution_release | debian_release_compare('<', 'noble'))) + when: (ansible_distribution == 'Debian' and (ansible_distribution_release | debian_release_compare('<', 'trixie'))) or + (ansible_distribution == 'Ubuntu' and (ansible_distribution_release | ubuntu_release_compare('<', 'noble'))) apt: name: dstat state: present diff --git a/roles/core/cpu-microcode/tasks/Debian.yml b/roles/core/cpu-microcode/tasks/Debian.yml index 01fdd8b0..6c37098c 100644 --- a/roles/core/cpu-microcode/tasks/Debian.yml +++ b/roles/core/cpu-microcode/tasks/Debian.yml @@ -2,7 +2,7 @@ - name: check if non-free and contrib apt component is enabled for debian when: - 'ansible_distribution == "Debian"' - - '(ansible_distribution_major_version | int) <= 11' + - '(ansible_distribution_release| debian_release_compare("<=", "bullseye"))' - 'ansible_architecture in ["i386", "x86_64"]' assert: msg: "On Debian microcode-update packages are in non-free - please enable it (and contrib) using 'apt_repo_components'" diff --git a/roles/core/ntp/tasks/Debian_systemd-timesyncd.yml b/roles/core/ntp/tasks/Debian_systemd-timesyncd.yml index 40c6629e..5fa60510 100644 --- a/roles/core/ntp/tasks/Debian_systemd-timesyncd.yml +++ b/roles/core/ntp/tasks/Debian_systemd-timesyncd.yml @@ -7,7 +7,8 @@ msg: "systemd-timesyncd can not be used as a NTP server or sync to local clocks" - name: install systemd-timesyncd - when: (ansible_distribution == 'Debian' and (ansible_distribution_major_version | int) > 10) or (ansible_distribution == 'Ubuntu') + when: (ansible_distribution == 'Debian' and (ansible_distribution_release | debian_release_compare('>', 'buster'))) or + (ansible_distribution == 'Ubuntu') apt: name: systemd-timesyncd state: present -- cgit v1.2.3