zeroclaw, refactor runit section into a block as well as service and wait into loops.
This commit is contained in:
@@ -92,54 +92,53 @@
|
||||
- "{{ zerocode }}"
|
||||
state: present
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | runit | Dir | Run
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit
|
||||
block:
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Dir | Run
|
||||
ansible.builtin.file:
|
||||
name: "{{ ollama_runit_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | runit | Dir | Log Run
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Dir | Log Run
|
||||
ansible.builtin.file:
|
||||
name: "{{ ollama_runit_log_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | runit | Dir | Log Config
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Dir | Log Config
|
||||
ansible.builtin.file:
|
||||
name: "{{ ollama_runit_log_dest }}"
|
||||
state: directory
|
||||
owner: "{{ user }}"
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | runit | Script | Run
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Script | Run
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
#!/bin/sh -e
|
||||
# Allow pulling LLMs for use with ZeroClaw.
|
||||
exec 2>&1
|
||||
export HOME={{ user_user.home }}
|
||||
export OLLAMA_KEEP_ALIVE=-1
|
||||
export OLLAMA_MAX_LOADED_MODELS=1
|
||||
export OLLAMA_KEEP_ALIVE=0 # default 5m
|
||||
export OLLAMA_REQUEST_TIMEOUT=600 # default 300
|
||||
export OLLAMA_MAX_LOADED_MODELS=1 # default is 3 if using CPUs, or 3 * NumGPUs
|
||||
exec chpst -u {{ user }} ollama serve
|
||||
dest: "{{ ollama_runit_script }}"
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | runit | Script | Log
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Script | Log
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
#!/bin/sh -e
|
||||
exec svlogd -tt {{ ollama_runit_log_dest }}
|
||||
dest: "{{ ollama_runit_log_script }}"
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | runit | Script | Log Config
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Script | Log Config
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
s10000000 # rotate at 10 MB
|
||||
@@ -147,39 +146,29 @@
|
||||
dest: "{{ ollama_runit_log_config }}"
|
||||
owner: "{{ user }}"
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | Enable
|
||||
ansible.builtin.service:
|
||||
name: "{{ ollama }}"
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Dir | Run
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Dir | Run
|
||||
ansible.builtin.file:
|
||||
name: "{{ zeroclaw_runit_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Dir | Log
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Dir | Log
|
||||
ansible.builtin.file:
|
||||
name: "{{ zeroclaw_runit_log_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Dir | Log Config
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Dir | Log Config
|
||||
ansible.builtin.file:
|
||||
name: "{{ zeroclaw_runit_log_dest }}"
|
||||
state: directory
|
||||
owner: "{{ user }}"
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Script | File
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Script | File
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
#!/bin/sh -e
|
||||
@@ -188,41 +177,46 @@
|
||||
exec chpst -u {{ user }} zeroclaw daemon
|
||||
dest: "{{ zeroclaw_runit_script }}"
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Script | Log
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Script | Log
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
#!/bin/sh -e
|
||||
exec svlogd -tt {{ zeroclaw_runit_log_dest }}
|
||||
dest: "{{ zeroclaw_runit_log_script }}"
|
||||
mode: "0755"
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | runit | Script | Log Config
|
||||
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Script | Log Config
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
s1000000 # rotate at 1 MB
|
||||
n5 # keep 5 old files
|
||||
dest: "{{ zeroclaw_runit_log_config }}"
|
||||
mode: "0755"
|
||||
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | Enable
|
||||
- name: Workstation | Linux | Software | ZeroClaw | Enable
|
||||
ansible.builtin.service:
|
||||
name: "{{ zeroclaw }}"
|
||||
name: "{{ item }}"
|
||||
state: started
|
||||
enabled: true
|
||||
loop:
|
||||
- "{{ ollama }}"
|
||||
- "{{ zeroclaw }}"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | Wait
|
||||
- name: Workstation | Linux | Software | ZeroClaw | Verify
|
||||
ansible.builtin.uri:
|
||||
url: http://127.0.0.1:11434/
|
||||
url: "{{ item }}"
|
||||
status_code: 200
|
||||
timeout: 5
|
||||
register: health
|
||||
until: health.status == 200
|
||||
retries: 12
|
||||
delay: 5
|
||||
loop:
|
||||
- http://127.0.0.1:11434/
|
||||
- http://127.0.0.1:42617/health
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | ollama | Models | Install
|
||||
ansible.builtin.shell: |
|
||||
@@ -264,14 +258,4 @@
|
||||
become: true
|
||||
become_user: "{{ user }}"
|
||||
|
||||
- name: Workstation | Linux | Software | ZeroClaw | zeroclaw | Wait
|
||||
ansible.builtin.uri:
|
||||
url: http://127.0.0.1:42617/health
|
||||
status_code: 200
|
||||
timeout: 5
|
||||
register: health
|
||||
until: health.status == 200
|
||||
retries: 12
|
||||
delay: 5
|
||||
|
||||
when: ansible_pkg_mgr == "pacman"
|
||||
|
||||
Reference in New Issue
Block a user