summaryrefslogtreecommitdiff
path: root/ansible/roles/thinkpad
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-08-20 12:20:28 +0300
committerLars Wirzenius <liw@liw.fi>2021-08-20 12:20:28 +0300
commitb6436165ac8bc529cc5c37bc3d7d55dd2c6cbb51 (patch)
tree456e23625fdc1bab12c6f9736c09aef024f28c0d /ansible/roles/thinkpad
parent16313a63a382d7ac3991d1f7e75105fc05609582 (diff)
downloadansibleness-b6436165ac8bc529cc5c37bc3d7d55dd2c6cbb51.tar.gz
add thinkpad role to exolobe1
Sponsored-by: author
Diffstat (limited to 'ansible/roles/thinkpad')
-rw-r--r--ansible/roles/thinkpad/files/tlp.conf16
-rw-r--r--ansible/roles/thinkpad/tasks/main.yml14
2 files changed, 30 insertions, 0 deletions
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