From d07e6ca2fbe57a3a5e4a192143fd660f8a9a381c Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Tue, 27 Aug 2024 06:36:35 -0500 Subject: [PATCH] role: move vars out of defaults, inline constant list --- roles/tuned_amdgpu/tasks/main.yml | 4 ++-- roles/tuned_amdgpu/{defaults => vars}/main.yml | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) rename roles/tuned_amdgpu/{defaults => vars}/main.yml (50%) diff --git a/roles/tuned_amdgpu/tasks/main.yml b/roles/tuned_amdgpu/tasks/main.yml index 6167ab0..7910010 100644 --- a/roles/tuned_amdgpu/tasks/main.yml +++ b/roles/tuned_amdgpu/tasks/main.yml @@ -71,7 +71,7 @@ path: "{{ (tuned_amdgpu_profile_dir, item.1 + '-amdgpu-' + item.0) | ansible.builtin.path_join }}" mode: "0755" with_nested: - - "{{ amdgpu_profiles }}" + - ['default', 'overclock', 'peak'] - "{{ base_profiles }}" become: true @@ -93,7 +93,7 @@ group: root mode: "0644" with_nested: - - "{{ amdgpu_profiles }}" + - ['default', 'overclock', 'peak'] - "{{ base_profiles }}" notify: Restart tuned become: true diff --git a/roles/tuned_amdgpu/defaults/main.yml b/roles/tuned_amdgpu/vars/main.yml similarity index 50% rename from roles/tuned_amdgpu/defaults/main.yml rename to roles/tuned_amdgpu/vars/main.yml index fe05157..10c479a 100644 --- a/roles/tuned_amdgpu/defaults/main.yml +++ b/roles/tuned_amdgpu/vars/main.yml @@ -1,14 +1,5 @@ --- # defaults file for tuned_amdgpu # - -# internals for profile power calculations -# item in the context of the with_nested loops in the play -profile_name: "{{ item.0 }}" - -amdgpu_profiles: - - default - - overclock - - peak - +# adjust where profiles are rendered based on the 'tuned' release from package facts tuned_amdgpu_profile_dir: "{{ '/etc/tuned' if ansible_facts['packages']['tuned'][0]['version'] is version('2.23.0', '<') else '/etc/tuned/profiles' }}"