llm, always do the setup steps, then XYZ_enabled vars are used to disable and stop services not wanted.
This commit is contained in:
@@ -296,39 +296,38 @@
|
|||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-webui
|
|
||||||
block:
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Packages
|
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- docker
|
- docker
|
||||||
state: present
|
state: present
|
||||||
|
when: open_webui_enabled
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Packages | init
|
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Packages | init
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- docker-runit
|
- docker-runit
|
||||||
state: present
|
state: present
|
||||||
when: ansible_pkg_mgr == "pacman"
|
when: open_webui_enabled
|
||||||
|
and ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | /etc/sv
|
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | /etc/sv
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
name: "/etc/sv/open_webui/log"
|
name: "/etc/sv/open-webui/log"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
owner: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | /var/log
|
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | /var/log
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
name: "/var/log/open_webui"
|
name: "/var/log/open-webui"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Script | File
|
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Script | File
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /etc/sv/open_webui/run
|
dest: /etc/sv/open-webui/run
|
||||||
content: |
|
content: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
@@ -361,35 +360,33 @@
|
|||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Script | Log
|
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Script | Log
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /etc/sv/open_webui/log/run
|
dest: /etc/sv/open-webui/log/run
|
||||||
content: |
|
content: |
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
exec svlogd -tt /var/log/open_webui
|
exec svlogd -tt /var/log/open-webui
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Script | Log Config
|
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Script | Log Config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /var/log/open_webui/config
|
dest: /var/log/open-webui/config
|
||||||
content: |
|
content: |
|
||||||
s1000000 # rotate at 1 MB
|
s1000000 # rotate at 1 MB
|
||||||
n5 # keep 5 old files
|
n5 # keep 5 old files
|
||||||
dateformat %Y-%m-%d_%H-%M-%S # each run gets its own file.
|
dateformat %Y-%m-%d_%H-%M-%S # each run gets its own file.
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
when: open_webui_enabled
|
|
||||||
|
|
||||||
when: ansible_service_mgr == "runit"
|
when: ansible_service_mgr == "runit"
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | Services | Enable
|
- name: Workstation | Linux | Software | LLMs | Services | Enable
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: "{{ item }}"
|
name: "{{ item.name }}"
|
||||||
state: started
|
state: "{{ 'started' if item.status else 'stopped' }}"
|
||||||
enabled: true
|
enabled: "{{ item.status }}"
|
||||||
loop:
|
loop:
|
||||||
- "{{ ollama if ollama_enabled else dummy_service }}"
|
- { 'name': "{{ ollama }}" , 'status': "{{ ollama_enabled }}" }
|
||||||
- "{{ zeroclaw if zeroclaw_enabled else dummy_service }}"
|
- { 'name': "{{ zeroclaw }}", 'status': "{{ zeroclaw_enabled }}" }
|
||||||
- "{{ 'docker' if open_webui_enabled else dummy_service }}"
|
- { 'name': 'docker' , 'status': true }
|
||||||
- "{{ 'open_webui' if open_webui_enabled else dummy_service }}"
|
- { 'name': 'open-webui' , 'status': "{{ open_webui_enabled }}" }
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | Services | Verify
|
- name: Workstation | Linux | Software | LLMs | Services | Verify
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
|
|||||||
Reference in New Issue
Block a user