From edec84400ebe9aa4408238bfd5689de17e9cc8ef Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 2 Aug 2026 13:47:44 -0700 Subject: [PATCH] runit, fix the enabling and disabling for services and tlp playbooks. --- tasks/general/software/services.yml | 14 +++++++------- tasks/workstation/linux/software/tlp.yml | 5 ++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tasks/general/software/services.yml b/tasks/general/software/services.yml index b9d8282..a9ac2de 100644 --- a/tasks/general/software/services.yml +++ b/tasks/general/software/services.yml @@ -135,15 +135,15 @@ when: ansible_service_mgr != "runit" - name: General | Software | Services | Disable (runit) - service: - name: "{{ item.name }}" - state: stopped - enabled: no + shell: | + if [[ -e {{ runit_service_dir }}/{{ item.name }} ]]; then + rm -v {{ runit_service_dir }}/{{ item.name }} + fi ignore_errors: yes loop: - - {name: "{{ cups }}" - - {name: "{{ cups_pattern }}" - - {name: "{{ cups_browse }}"} + - {name: "{{ cups }}" } + - {name: "{{ cups_pattern }}" } + - {name: "{{ cups_browse }}" } - {name: "{{ cups_browse_pattern }}"} when: ansible_service_mgr == "runit" diff --git a/tasks/workstation/linux/software/tlp.yml b/tasks/workstation/linux/software/tlp.yml index 12a1988..20788bb 100644 --- a/tasks/workstation/linux/software/tlp.yml +++ b/tasks/workstation/linux/software/tlp.yml @@ -98,6 +98,9 @@ when: ansible_service_mgr not in ("runit") - name: Workstation | Linux | Software | TLP | Enable + Start (runit) - shell: "ln -s {{runit_script_dir }}/tlp {{ runit_service_dir }}/tlp" + shell: | + if [[ ! -e {{ runit_service_dir }}/tlp ]]; then + ln -s {{ runit_script_dir }}/tlp {{ runit_service_dir }}/tlp + fi when: ansible_service_mgr == "runit"