From fdb8a3c6a145d23650a12a24600dc3010a62ed62 Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Sun, 11 Aug 2024 06:24:54 -0500 Subject: [PATCH] role/profile dir: use ternary instead of task --- roles/tuned_amdgpu/defaults/main.yml | 2 +- roles/tuned_amdgpu/tasks/main.yml | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/roles/tuned_amdgpu/defaults/main.yml b/roles/tuned_amdgpu/defaults/main.yml index 92ffeee..fe05157 100644 --- a/roles/tuned_amdgpu/defaults/main.yml +++ b/roles/tuned_amdgpu/defaults/main.yml @@ -11,4 +11,4 @@ amdgpu_profiles: - overclock - peak -tuned_amdgpu_profile_dir: '/etc/tuned/profiles' # introduced in '2.23.0-1' +tuned_amdgpu_profile_dir: "{{ '/etc/tuned' if ansible_facts['packages']['tuned'][0]['version'] is version('2.23.0', '<') else '/etc/tuned/profiles' }}" diff --git a/roles/tuned_amdgpu/tasks/main.yml b/roles/tuned_amdgpu/tasks/main.yml index fa1fc5c..6167ab0 100644 --- a/roles/tuned_amdgpu/tasks/main.yml +++ b/roles/tuned_amdgpu/tasks/main.yml @@ -5,11 +5,6 @@ ansible.builtin.package_facts: manager: auto -- name: Use legacy custom-profile directory when < 2.23.0 - ansible.builtin.set_fact: - tuned_amdgpu_profile_dir: "/etc/tuned" - when: ansible_facts['packages']['tuned'][0]['version'] is version('2.23.0', '<') # versions are in a list...? pick the first; only expect one - # around Fedora 35/36, the packages for 'power-profiles-daemon' and 'tuned' conflicted; no more - can coincide # ensuring the service is masked should suffice - not removed; gnome/others may 'require' it. doing so may remove them implicitly - name: Ensure power-profiles-daemon is off/disabled/masked