diff options
author | Christian Pointner <equinox@spreadspace.org> | 2024-05-10 00:19:23 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2024-05-10 00:19:23 +0200 |
commit | 6abc58229f057a63e1799c834538d5fb139c6e22 (patch) | |
tree | 80c6639e569e2e83640d7fcce5b39d258aa6dd06 /roles/core | |
parent | make debian/ubuntu os release compare script much more generic (diff) |
migrate all os release comparisons to use new filter
Diffstat (limited to 'roles/core')
-rw-r--r-- | roles/core/base/tasks/Debian.yml | 3 | ||||
-rw-r--r-- | roles/core/cpu-microcode/tasks/Debian.yml | 2 | ||||
-rw-r--r-- | roles/core/ntp/tasks/Debian_systemd-timesyncd.yml | 3 |
3 files changed, 5 insertions, 3 deletions
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 |