From ddfa5d5d81ef9fc9bad2f5fadc972d67f5514e0e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 6 Oct 2026 15:40:12 -0700 Subject: [PATCH] zeroclaw, use a runit script which de-escalates to the user. --- tasks/workstation/linux/software/zeroclaw.yml | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tasks/workstation/linux/software/zeroclaw.yml b/tasks/workstation/linux/software/zeroclaw.yml index 9baa5d2..7b133dd 100644 --- a/tasks/workstation/linux/software/zeroclaw.yml +++ b/tasks/workstation/linux/software/zeroclaw.yml @@ -60,31 +60,25 @@ - "{{ ollama }}" state: present - #- name: Workstation | Linux | Software | ZeroClaw | ollama | Script [runit] - # ansible.builtin.shell: "{{ item }}" - # loop: - # - "mkdir -p {{ ollama_runit_dir }}" - # - "echo '#!/bin/sh' > {{ ollama_runit_start }}" - # - "echo 'ollama serve' >> {{ ollama_runit_start }}" - # - "chmod +x {{ ollama_runit_start }}" - # register: shell_check - # changed_when: shell_check.rc == 0 - # when: ansible_service_mgr == "runit" - ## This is safe to run without wasting too many resources, allows pulling. - #- name: Workstation | Linux | Software | ZeroClaw | ollama | Enable - # ansible.builtin.service: - # name: "{{ ollama }}" - # state: started - # enabled: true + - name: Workstation | Linux | Software | ZeroClaw | ollama | Script [runit] + ansible.builtin.shell: "{{ item }}" + loop: + - "mkdir -p {{ ollama_runit_dir }}" + - "echo '#!/bin/sh -e' > {{ ollama_runit_start }}" + - "echo '# Allow pulling LLMs for use with ZeroClaw.'>> {{ ollama_runit_start }}" + - "echo 'exec 2>&1' >> {{ ollama_runit_start }}" + - "echo 'exec chpst -u {{ user }} ollama serve' >> {{ ollama_runit_start }}" + - "chmod +x {{ ollama_runit_start }}" + register: shell_check + changed_when: shell_check.rc == 0 + when: ansible_service_mgr == "runit" - name: Workstation | Linux | Software | ZeroClaw | ollama | Enable - ansible.builtin.blockinfile: - path: "{{ user_user.home }}/.config/i3/config" - marker: "# {mark} MANAGED BY ANSIBLE | zeroclaw" - block: | - exec_always --no-startup-id pgrep -x ollama || ollama serve >~/Reports/{{ ansible_hostname }}.ollama.log 2>&1 - state: present + ansible.builtin.service: + name: "{{ ollama }}" + state: started + enabled: true - name: Workstation | Linux | Software | ZeroClaw | Models | Install ansible.builtin.shell: |