refactor, two profiles

This commit is contained in:
Josh Lay 2023-06-03 17:40:20 -05:00
parent bb03fc2cc2
commit c833a9a36e
Signed by: jlay
GPG key ID: B265E45CACAD108A
6 changed files with 82 additions and 106 deletions

View file

@ -28,38 +28,6 @@
when: (fed_ppdtuned_swap is not defined) or ('tuned' not in ansible_facts.packages)
become: true
- name: Determine GPU device in drm subsystem
ansible.builtin.shell:
cmd: grep -ls ^connected /sys/class/drm/*/status | grep -o card[0-9] | sort | uniq | sort -h | tail -1
executable: /bin/bash
changed_when: false
register: card
- name: Find hwmon/max power capability file for {{ card.stdout }}
ansible.builtin.find:
paths: /sys/class/drm/{{ card.stdout }}/device/hwmon
file_type: file
recurse: true
use_regex: true
patterns:
- '^power1_cap_max$'
register: hwmon
- name: Find hwmon/current power limit file for {{ card.stdout }}
ansible.builtin.find:
paths: /sys/class/drm/{{ card.stdout }}/device/hwmon
file_type: file
recurse: true
use_regex: true
patterns:
- '^power1_cap$'
register: powercap_set
- name: Get max power capability for {{ card.stdout }}
ansible.builtin.slurp:
src: "{{ hwmon.files.0.path }}"
register: power_max_b64
- name: Create custom profile directories
ansible.builtin.file:
state: directory