zeroclaw, use a runit script which de-escalates to the user.
This commit is contained in:
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user