From c481b74b5d73eab11c6f335e757d3eae1210b315 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 11 Aug 2026 11:06:35 -0700 Subject: [PATCH] tlp, add tasks to enable TLP on Devuan using runit. --- tasks/workstation/linux/software/tlp.yml | 28 +++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tasks/workstation/linux/software/tlp.yml b/tasks/workstation/linux/software/tlp.yml index 0d78e26..f1f3526 100644 --- a/tasks/workstation/linux/software/tlp.yml +++ b/tasks/workstation/linux/software/tlp.yml @@ -106,10 +106,32 @@ enabled: true when: ansible_service_mgr not in ("runit") -- name: Workstation | Linux | Software | TLP | Enable + Start (runit) +- name: Workstation | Linux | Software | TLP | runit | Devuan Block + block: + + - name: Workstation | Linux | Software | TLP | runit | Devuan | Facts 01 + set_fact: + devuan_tlp_dir: "{{ runit_script_dir }}/{{ tlp_service }}" + + - name: Workstation | Linux | Software | TLP | runit | Devuan | Facts 02 + set_fact: + devuan_tlp_run: "{{ devuan_tlp_dir }}/run" + + - name: Workstation | Linux | Software | TLP | runit | Devuan | Create Script + shell: "{{ item }}" + loop: + - "mkdir -pv {{ devuan_tlp_dir }}" + - "echo '#!/bin/sh' > {{ devuan_tlp_run }}" + - "echo 'exec /usr/sbin/{{ tlp_service }} start' >> {{ devuan_tlp_run }}" + - "chmod +x {{ devuan_tlp_run }}" + + when: ansible_service_mgr == "runit" + and ansible_pkg_mgr == "apt" + +- name: Workstation | Linux | Software | TLP | runit | Enable + Start shell: | - if [[ ! -e {{ runit_service_dir }}/tlp ]]; then - ln -s {{ runit_script_dir }}/tlp {{ runit_service_dir }}/tlp + if [[ ! -e {{ runit_service_dir }}/{{ tlp_service }} ]]; then + ln -s {{ runit_script_dir }}/{{ tlp_service }} {{ runit_service_dir }}/ fi when: ansible_service_mgr == "runit"