role/profile dir: use ternary instead of task

This commit is contained in:
Josh Lay 2024-08-11 06:24:54 -05:00
parent 369385b192
commit fdb8a3c6a1
No known key found for this signature in database
GPG key ID: 47AA304B2243B579
2 changed files with 1 additions and 6 deletions

View file

@ -11,4 +11,4 @@ amdgpu_profiles:
- overclock - overclock
- peak - 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' }}"

View file

@ -5,11 +5,6 @@
ansible.builtin.package_facts: ansible.builtin.package_facts:
manager: auto 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 # 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 # 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 - name: Ensure power-profiles-daemon is off/disabled/masked