Move the power role into the CPU role.

This commit is contained in:
Tom Alexander
2023-03-23 16:33:47 -04:00
parent 977e382726
commit 4e957fa959
12 changed files with 3 additions and 58 deletions

View File

@@ -0,0 +1,2 @@
# Disable turboboost. This makes the laptop significantly quieter and probably helps battery life.
w- /sys/devices/system/cpu/intel_pstate/no_turbo - - - - 1

View File

@@ -1,6 +1,2 @@
# - name: Install packages
# pacman:
# name:
# - foo
# state: present
# update_cache: true
- include_tasks: "tasks/linux_{{cputype}}.yaml"
when: cputype is defined

View File

@@ -0,0 +1,27 @@
- name: Install packages
package:
name:
- powertop
state: present
- name: Install tmpfiles.d configuration
copy:
src: "files/{{ item }}_tmpfiles.conf"
dest: "/etc/tmpfiles.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- disable_turboboost
- name: Favor energy efficiency for Speed Shift
when: hwpstate is defined and hwpstate and cores is defined
template:
src: "templates/{{ item.src }}.j2"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: energy_performance_preference.conf
dest: /etc/tmpfiles.d/energy_performance_preference.conf

View File

@@ -0,0 +1,4 @@
# Favor energy efficiency for Speed Shift
{% for core in range(0, cores, 1) %}
w- /sys/devices/system/cpu/cpufreq/policy{{core}}/energy_performance_preference - - - - power
{% endfor %}