mirror of
https://github.com/Alkatrazz24/Funk-lab.git
synced 2026-07-08 08:44:43 +02:00
feat: initial commit — Ansible roles storage-01/gpu-01 opérationnels
This commit is contained in:
commit
b3fce8af5d
70 changed files with 2688 additions and 0 deletions
62
ansible/roles/litellm/tasks/main.yml
Normal file
62
ansible/roles/litellm/tasks/main.yml
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
---
|
||||
- name: Install Python pip and devel
|
||||
ansible.builtin.dnf:
|
||||
name:
|
||||
- python3-pip
|
||||
- python3-devel
|
||||
state: present
|
||||
|
||||
- name: Create litellm system user
|
||||
ansible.builtin.user:
|
||||
name: "{{ litellm_user }}"
|
||||
system: true
|
||||
shell: /sbin/nologin
|
||||
home: /opt/litellm
|
||||
create_home: true
|
||||
state: present
|
||||
|
||||
- name: Install litellm[proxy] in venv
|
||||
ansible.builtin.pip:
|
||||
name: "litellm[proxy]"
|
||||
virtualenv: "{{ litellm_venv }}"
|
||||
virtualenv_command: python3 -m venv
|
||||
state: present
|
||||
|
||||
- name: Create config directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ litellm_config_dir }}"
|
||||
state: directory
|
||||
owner: "{{ litellm_user }}"
|
||||
group: "{{ litellm_user }}"
|
||||
mode: '0750'
|
||||
|
||||
- name: Deploy LiteLLM config
|
||||
ansible.builtin.template:
|
||||
src: config.yaml.j2
|
||||
dest: "{{ litellm_config_dir }}/config.yaml"
|
||||
owner: "{{ litellm_user }}"
|
||||
group: "{{ litellm_user }}"
|
||||
mode: '0640'
|
||||
notify: Restart litellm
|
||||
|
||||
- name: Deploy systemd service
|
||||
ansible.builtin.template:
|
||||
src: litellm.service.j2
|
||||
dest: /etc/systemd/system/litellm.service
|
||||
mode: '0644'
|
||||
notify:
|
||||
- Reload systemd
|
||||
- Restart litellm
|
||||
|
||||
- name: Deploy hermes-switch script
|
||||
ansible.builtin.copy:
|
||||
src: hermes-switch
|
||||
dest: /usr/local/bin/hermes-switch
|
||||
mode: '0755'
|
||||
|
||||
- name: Enable and start litellm
|
||||
ansible.builtin.systemd:
|
||||
name: litellm
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
state: started
|
||||
Loading…
Add table
Add a link
Reference in a new issue