role: improve 'power-profiles-daemon'/'tuned' conflict res
This commit is contained in:
parent
0157538881
commit
efe17b682a
1 changed files with 10 additions and 16 deletions
|
@ -10,26 +10,19 @@
|
||||||
tuned_amdgpu_profile_dir: "/etc/tuned"
|
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
|
when: ansible_facts['packages']['tuned'][0]['version'] is version('2.23.0', '<') # versions are in a list...? pick the first; only expect one
|
||||||
|
|
||||||
# note: power-profiles-daemon conflicts with tuned
|
# around Fedora 35/36, the packages for 'power-profiles-daemon' and 'tuned' conflicted; no more - can coincide
|
||||||
# since F35 it must be removed so tuned may be installed
|
# ensuring the service is masked should suffice for their conflicts
|
||||||
- name: Replace 'power-profiles-daemon' with 'tuned' on Fedora 35+
|
- name: Ensure power-profiles-daemon is disabled/masked
|
||||||
ansible.builtin.package: # use with_items/pkg since 'dnf' module in Ansible doesn't support 'swap'
|
ansible.builtin.systemd_service:
|
||||||
name: "{{ item.name }}"
|
name: power-profiles-daemon
|
||||||
state: "{{ item.state }}"
|
enabled: false
|
||||||
with_items:
|
masked: true
|
||||||
- {name: 'power-profiles-daemon', state: 'absent'}
|
|
||||||
- {name: 'tuned', state: 'present'}
|
|
||||||
when:
|
|
||||||
- ansible_distribution == 'Fedora'
|
|
||||||
- ansible_distribution_major_version|int > 35
|
|
||||||
register: fed_ppdtuned_swap
|
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Install tuned
|
- name: Ensure 'tuned' is installed
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: tuned
|
name: tuned
|
||||||
state: present
|
state: present
|
||||||
when: (fed_ppdtuned_swap is not defined) or ('tuned' not in ansible_facts.packages)
|
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Ensure dynamic tuning is disabled
|
- name: Ensure dynamic tuning is disabled
|
||||||
|
@ -40,7 +33,7 @@
|
||||||
notify: Restart tuned
|
notify: Restart tuned
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Configure profile vars
|
- name: Configure vars in '/etc/tuned/amdgpu-profile-vars.conf'
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/tuned/amdgpu-profile-vars.conf
|
path: /etc/tuned/amdgpu-profile-vars.conf
|
||||||
line: "{{ item }}={{ vars[item] }}"
|
line: "{{ item }}={{ vars[item] }}"
|
||||||
|
@ -55,6 +48,7 @@
|
||||||
- gpu_power_multi_def
|
- gpu_power_multi_def
|
||||||
- gpu_power_multi_oc
|
- gpu_power_multi_oc
|
||||||
- gpu_mv_offset
|
- gpu_mv_offset
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: Create custom profile directories
|
- name: Create custom profile directories
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|
Loading…
Reference in a new issue