From b6436165ac8bc529cc5c37bc3d7d55dd2c6cbb51 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 20 Aug 2021 12:20:28 +0300 Subject: add thinkpad role to exolobe1 Sponsored-by: author --- ansible/roles/thinkpad/files/tlp.conf | 16 ++++++++++++++++ ansible/roles/thinkpad/tasks/main.yml | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ansible/roles/thinkpad/files/tlp.conf create mode 100644 ansible/roles/thinkpad/tasks/main.yml (limited to 'ansible/roles/thinkpad') diff --git a/ansible/roles/thinkpad/files/tlp.conf b/ansible/roles/thinkpad/files/tlp.conf new file mode 100644 index 0000000..a9312f9 --- /dev/null +++ b/ansible/roles/thinkpad/files/tlp.conf @@ -0,0 +1,16 @@ +TLP_ENABLE=1 + +CPU_SCALING_GOVERNOR_ON_AC=powersave +CPU_SCALING_GOVERNOR_ON_BAT=powersave + +START_CHARGE_THRESH_BAT0=75 +STOP_CHARGE_THRESH_BAT0=80 + +START_CHARGE_THRESH_BAT1=75 +STOP_CHARGE_THRESH_BAT1=80 + +RESTORE_THRESHOLDS_ON_BAT=1 + +NATACPI_ENABLE=1 +TPACPI_ENABLE=1 +TPSMAPI_ENABLE=1 diff --git a/ansible/roles/thinkpad/tasks/main.yml b/ansible/roles/thinkpad/tasks/main.yml new file mode 100644 index 0000000..a118236 --- /dev/null +++ b/ansible/roles/thinkpad/tasks/main.yml @@ -0,0 +1,14 @@ +- name: "install software to manage Thinkpads" + apt: + name: + - tlp + +- name: "configure tlp to manage batteries" + copy: + src: tlp.conf + dest: /etc/tlp.d/50-debian-ansible.conf + +- name: "start tlp" + systemd: + name: tlp + state: restarted -- cgit v1.2.1