- name: Setup ollama
  hosts: ollama
  vars:
    podman_user: "{{ ollama_user | default('ollama') }}"
    podman_group: "{{ ollama_group | default('ollama') }}"
    podman_extra_groups: "users"
    podman_user_home: "{{ ollama_home | default('/home/ollama') }}"
    podman_user_folders:
      - data
    pods:
      - name: ollama
        build:
          dockerfile: "{{ lookup('file', 'dockerfiles/Dockerfile.ollama') }}"
        ports:
          - "0.0.0.0:{{ ollama_port | default(11434) }}:11434/tcp"
        volumes:
          - "{{ ollama_home }}/data:/home/worker/.ollama:Z"
        device:
          - "nvidia.com/gpu=all"

  tasks:
    - name: Setup Pods
      ansible.builtin.include_tasks:
        file: tasks/podman.yml
