From 67148e651bffde5e0635466914494d4737c3f7f0 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Tue, 21 Jan 2025 00:02:11 +0100 Subject: [PATCH] refactor: adjusted ollama installation to use proper standards --- config/ansible/tasks/ollama.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/config/ansible/tasks/ollama.yml b/config/ansible/tasks/ollama.yml index 4ae3e20..83f0170 100644 --- a/config/ansible/tasks/ollama.yml +++ b/config/ansible/tasks/ollama.yml @@ -4,14 +4,23 @@ changed_when: false failed_when: false -- name: Install Ollama - ansible.builtin.shell: curl -fsSL https://ollama.com/install.sh | sh +- name: Download Ollama install script + ansible.builtin.get_url: + url: https://ollama.com/install.sh + dest: /tmp/install_ollama.sh + mode: '0755' when: ollama_check.rc != 0 +- name: Install Ollama + ansible.builtin.command: bash -c 'set -o pipefail && sh /tmp/install_ollama.sh' + when: ollama_check.rc != 0 + args: + creates: /usr/local/bin/ollama + - name: Check if Ollama is running ansible.builtin.systemd: name: ollama state: started - enabled: yes + enabled: true become: true register: ollama_service