From b051bce767a17ddad1287da651192efb4427d32d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 2 Aug 2026 12:28:24 -0700 Subject: [PATCH] tlp, attempt to automate enabling with runit. --- facts/general/system.yml | 12 +++++++++--- tasks/workstation/linux/software/tlp.yml | 12 ++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/facts/general/system.yml b/facts/general/system.yml index 481d8b7..c49118a 100644 --- a/facts/general/system.yml +++ b/facts/general/system.yml @@ -12,6 +12,8 @@ git_repo_ssh: ssh://git@{{ git_host }}:{{ git_ssh_port }}/{{ git_user }}/{{ git_project }} shared_rc_install_dir: ~/.git-env-shared notify_log: "ansible.notify.log" + runit_script_dir: /etc/runit/sv + runit_service_dir: /etc/runit/runsvdir/default - name: General | Facts | System | Global [2/2] set_fact: @@ -27,7 +29,6 @@ shutdown_command: sudo shutdown -h now when: ansible_system == "Linux" - - name: General | Facts | System | FreeBSD set_fact: rc_conf: /etc/rc.conf @@ -35,14 +36,19 @@ shutdown_command: sudo shutdown -p now when: ansible_system == "FreeBSD" - - name: General | Facts | System | Report File Names set_fact: lynis_report: "lynis_hardness_check.txt" nmap_report: "nmap_port_check.txt" - - name: General | Facts | System | Ansible Branch set_fact: branch: main when: branch is not defined + +- name: General | Facts | System | runit (Devuan) + set_fact: + runit_script_dir: /etc/sv + runit_service_dir: /etc/services + when: ansible_pkg_mgr == "apt" + diff --git a/tasks/workstation/linux/software/tlp.yml b/tasks/workstation/linux/software/tlp.yml index ad0801f..1741fa2 100644 --- a/tasks/workstation/linux/software/tlp.yml +++ b/tasks/workstation/linux/software/tlp.yml @@ -20,6 +20,7 @@ - name: Workstation | Linux | Software | TLP | Facts (Artix) set_fact: ppd_package: "power-profiles-daemon power-profiles-daemon-runit" + tlp: tlp tlp-runit when: ansible_pkg_mgr == "pacman" and ansible_service_mgr == "runit" @@ -52,6 +53,17 @@ - "{{ tlp_smart }}" update_cache: yes +- name: Workstation | Linux | Software | TLP | Enable + service: + name: tlp + state: started + enabled: yes + when: ansible_service_mgr not in ("runit") + +- name: Workstation | Linux | Software | TLP | Enable (runit, Artix) + shell: "ln -s {{runit_script_dir }}/tlp {{ runit_service_dir }}/tlp" + when: ansible_service_mgr == "runit" + ## Configuration ## # Device choices: