2026-04-03 09:19:18 +02:00

42 lines
1006 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: Vérifier que le système est Linux
assert:
that:
- ansible_facts.system == "Linux"
fail_msg: "Ollama est uniquement supporté sur Linux"
tags: ollama
- name: Vérifier si Ollama est déjà installé
ansible.builtin.stat:
path: "{{ ollama_bin }}"
register: ollama_bin_stat
tags: ollama
- name: Installer curl (prérequis)
ansible.builtin.apt:
name: curl
state: present
update_cache: yes
tags: ollama
- name: Télécharger le script dinstallation Ollama
ansible.builtin.get_url:
url: "{{ ollama_install_script }}"
dest: /tmp/ollama_install.sh
mode: '0755'
when: not ollama_bin_stat.stat.exists
tags: ollama
- name: Installer Ollama
ansible.builtin.command: /tmp/ollama_install.sh
when: not ollama_bin_stat.stat.exists
notify: Restart Ollama
tags: ollama
- name: Activer et démarrer le service Ollama
ansible.builtin.systemd:
name: "{{ ollama_service_name }}"
enabled: yes
state: started
tags: ollama