From cd38ba51e3af40d468fb40c8ad1311f9d6a91033 Mon Sep 17 00:00:00 2001 From: Daniel San Pedro Date: Tue, 27 Feb 2024 15:26:01 -0500 Subject: [PATCH] Break test into multiple lines so that we can pass lint checks --- roles/raspberrypi/tasks/setup/Raspbian.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/roles/raspberrypi/tasks/setup/Raspbian.yml b/roles/raspberrypi/tasks/setup/Raspbian.yml index 2778186..76c4e66 100644 --- a/roles/raspberrypi/tasks/setup/Raspbian.yml +++ b/roles/raspberrypi/tasks/setup/Raspbian.yml @@ -5,9 +5,18 @@ failed_when: false changed_when: false -- name: Set cmdline path based on Debian version and boot_cmdline_path result +- name: Set cmdline path based on Debian version and command result set_fact: - cmdline_path: "{{ (boot_cmdline_path.rc == 0 and ansible_facts['distribution'] == 'Debian' and ansible_facts['distribution_version'] is version('bookworm', '<')) | ternary('/boot/cmdline.txt', '/boot/firmware/cmdline.txt') }}" + cmdline_path: >- + {{ + ( + boot_cmdline_path.rc == 0 and + ansible_facts.lsb.description | default('') is match('Debian.*(?!(bookworm|sid))') + ) | ternary( + '/boot/cmdline.txt', + '/boot/firmware/cmdline.txt' + ) + }} - name: Activating cgroup support lineinfile: