refactor: reorganize Ansible tasks for better structure and include common package installations
All checks were successful
Nix Format Check / check-format (pull_request) Successful in 40s
All checks were successful
Nix Format Check / check-format (pull_request) Successful in 40s
This commit is contained in:
26
config/ansible/tasks/global/ollama.yml
Normal file
26
config/ansible/tasks/global/ollama.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
- name: Check if Ollama is installed
|
||||
ansible.builtin.command: ollama --version
|
||||
register: ollama_check
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- 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: true
|
||||
become: true
|
||||
register: ollama_service
|
Reference in New Issue
Block a user