36 lines
935 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
ansible.builtin.assert:
that:
- ansible_facts['kernel'] == "Linux"
fail_msg: "Ollama est uniquement supporté sur Linux"
- name: Vérifier si Ollama est déjà installé
ansible.builtin.stat:
path: "{{ ollama_bin }}"
register: ollama_bin_stat
- name: Installer curl (prérequis)
ansible.builtin.apt:
name: curl
state: present
update_cache: yes
- 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
- name: Installer Ollama
ansible.builtin.command: /tmp/ollama_install.sh
when: not ollama_bin_stat.stat.exists
notify: Restart Ollama
- name: Activer et démarrer le service Ollama
ansible.builtin.systemd:
name: "{{ ollama_service_name }}"
enabled: yes
state: started