From aea8c043d893e26ca07773ea8308f7103d0a0ed8 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Sun, 22 Jan 2023 17:40:57 +0000 Subject: [PATCH] Use _release instead of _version In testing, only the codename is filled out, so ansible_distribution_version ends up being "n/a". --- roles/debian/tasks/apt-sources.yml | 6 +++--- roles/debian/tasks/xkb-lv5.yml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/debian/tasks/apt-sources.yml b/roles/debian/tasks/apt-sources.yml index 4082de3..6b51a52 100644 --- a/roles/debian/tasks/apt-sources.yml +++ b/roles/debian/tasks/apt-sources.yml @@ -18,21 +18,21 @@ ansible.builtin.copy: src: sources.list.10 dest: "/etc/apt/sources.list" - when: ansible_distribution_version == "10" + when: ansible_distribution_release == "buster" - name: Set APT sources.list for Debian 11 become: true ansible.builtin.copy: src: sources.list.11 dest: "/etc/apt/sources.list" - when: ansible_distribution_version == "11" + when: ansible_distribution_release == "bullseye" - name: Set APT sources.list for Debian 12 become: true ansible.builtin.copy: src: sources.list.12 dest: "/etc/apt/sources.list" - when: ansible_distribution_version == "12" + when: ansible_distribution_release == "bookworm" - name: Update APT cache become: true diff --git a/roles/debian/tasks/xkb-lv5.yml b/roles/debian/tasks/xkb-lv5.yml index bcc274a..eb86bb5 100644 --- a/roles/debian/tasks/xkb-lv5.yml +++ b/roles/debian/tasks/xkb-lv5.yml @@ -19,11 +19,12 @@ src: debian-11-add-lv5-rctrl-switch.patch basedir: /usr/share/X11/xkb/rules strip: 1 - when: ansible_distribution_version == "11" + when: ansible_distribution_release == "bullseye" + - name: Enable lv5:rctrl_switch on Debian 12 become: true ansible.posix.patch: src: debian-12-add-lv5-rctrl-switch.patch basedir: /usr/share/X11/xkb/rules strip: 1 - when: ansible_distribution_version == "12" + when: ansible_distribution_release == "bookworm"