Files
ouranos/ansible/lobechat/deploy.yml
Robert Helewka 042df52bca Refactor user management in Ansible playbooks to standardize on keeper_user
- Updated user addition tasks across multiple playbooks (mcp_switchboard, mcpo, neo4j, neo4j_mcp, openwebui, postgresql, rabbitmq, searxng, smtp4dev) to replace references to ansible_user and remote_user with keeper_user.
- Modified PostgreSQL deployment to create directories and manage files under keeper_user's home.
- Enhanced documentation to clarify account taxonomy and usage of keeper_user in playbooks.
- Introduced new deployment for Agent S, including environment setup, desktop environment installation, XRDP configuration, and accessibility support.
- Added staging playbook for preparing release tarballs from local repositories.
- Created templates for XRDP configuration and environment activation scripts.
- Removed obsolete sunwait documentation.
2026-03-05 10:37:41 +00:00

83 lines
2.2 KiB
YAML

---
- name: Deploy LobeChat to Dev Environment
hosts: ubuntu
tasks:
- name: Check if host has lobechat service
ansible.builtin.set_fact:
has_lobechat_service: "{{ 'lobechat' in services | default([]) }}"
- name: Skip hosts without lobechat service
ansible.builtin.meta: end_host
when: not has_lobechat_service
- name: Create lobechat group
become: true
ansible.builtin.group:
name: "{{lobechat_user}}"
- name: Create lobechat user
become: true
ansible.builtin.user:
name: "{{lobechat_user}}"
comment: "{{lobechat_user}}"
group: "{{lobechat_group}}"
system: true
- name: Add group lobechat to keeper_user
become: true
ansible.builtin.user:
name: "{{keeper_user}}"
groups: "{{lobechat_group}}"
append: true
- name: Create lobechat directory
become: true
ansible.builtin.file:
path: "{{lobechat_directory}}"
owner: "{{lobechat_user}}"
group: "{{lobechat_group}}"
state: directory
mode: '750'
- name: Template docker-compose file
become: true
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{lobechat_directory}}/docker-compose.yml"
owner: "{{lobechat_user}}"
group: "{{lobechat_group}}"
mode: '550'
register: lobechat_compose
- name: Reset SSH connection to apply group changes
meta: reset_connection
- name: Start LobeChat service
become: true
community.docker.docker_compose_v2:
project_src: "{{lobechat_directory}}"
state: present
pull: always
- name: Restart LobeChat if configuration changed
become: true
community.docker.docker_compose_v2:
project_src: "{{lobechat_directory}}"
state: restarted
when: lobechat_compose.changed
- name: Wait for LobeChat to be healthy
ansible.builtin.uri:
url: "http://localhost:{{lobechat_port}}/chat"
method: GET
status_code: 200
register: lobechat_health
until: lobechat_health.status == 200
retries: 30
delay: 5
delegate_to: "{{inventory_hostname}}"
- name: Display LobeChat status
ansible.builtin.debug:
msg: "LobeChat is running at http://{{inventory_hostname}}:{{lobechat_port}}"