feat: Add Open WebUI role to the first host
This commit is contained in:
parent
8411365d0c
commit
c4c8e86486
@ -3,4 +3,5 @@
|
|||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- portainer
|
- portainer
|
||||||
|
- openwebui
|
||||||
34
playbooks/roles/openwebui/README.md
Normal file
34
playbooks/roles/openwebui/README.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Ansible Role: Open WebUI Docker Compose
|
||||||
|
|
||||||
|
An Ansible role to deploy Open WebUI using Docker Compose.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- Docker
|
||||||
|
- Docker Compose
|
||||||
|
|
||||||
|
## Role Variables
|
||||||
|
|
||||||
|
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
openwebui_data_dir: "/opt/open-webui"
|
||||||
|
openwebui_port: 8080
|
||||||
|
openwebui_ollama_base_url: "http://localhost:11434"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
- docker
|
||||||
|
|
||||||
|
## Example Playbook
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- hosts: "servers"
|
||||||
|
roles:
|
||||||
|
- role: "openwebui"
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
4
playbooks/roles/openwebui/defaults/main.yml
Normal file
4
playbooks/roles/openwebui/defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
openwebui_data_dir: "/opt/open-webui"
|
||||||
|
openwebui_port: 8080
|
||||||
|
openwebui_ollama_base_url: "http://localhost:11434"
|
||||||
12
playbooks/roles/openwebui/meta/main.yml
Normal file
12
playbooks/roles/openwebui/meta/main.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
galaxy_info:
|
||||||
|
author: "Your Name"
|
||||||
|
description: "An Ansible role to deploy Open WebUI using Docker Compose"
|
||||||
|
license: "MIT"
|
||||||
|
min_ansible_version: "2.9"
|
||||||
|
platforms:
|
||||||
|
- name: "Ubuntu"
|
||||||
|
versions:
|
||||||
|
- "focal"
|
||||||
|
- "bionic"
|
||||||
|
dependencies:
|
||||||
|
- role: docker
|
||||||
16
playbooks/roles/openwebui/tasks/main.yml
Normal file
16
playbooks/roles/openwebui/tasks/main.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
- name: "Create Open WebUI directory"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ openwebui_data_dir }}"
|
||||||
|
state: "directory"
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: "Create Open WebUI docker-compose.yml"
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "docker-compose.yml.j2"
|
||||||
|
dest: "{{ openwebui_data_dir }}/docker-compose.yml"
|
||||||
|
|
||||||
|
- name: "Start Open WebUI services"
|
||||||
|
community.docker.docker_compose:
|
||||||
|
project_src: "{{ openwebui_data_dir }}"
|
||||||
|
state: "present"
|
||||||
13
playbooks/roles/openwebui/templates/docker-compose.yml.j2
Normal file
13
playbooks/roles/openwebui/templates/docker-compose.yml.j2
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
open-webui:
|
||||||
|
image: ghcr.io/open-webui/open-webui:main
|
||||||
|
container_name: open-webui
|
||||||
|
ports:
|
||||||
|
- "{{ openwebui_port }}:8080"
|
||||||
|
volumes:
|
||||||
|
- "{{ openwebui_data_dir }}:/app/backend/data"
|
||||||
|
environment:
|
||||||
|
- OLLAMA_BASE_URL={{ openwebui_ollama_base_url }}
|
||||||
|
restart: always
|
||||||
Loading…
x
Reference in New Issue
Block a user