Normalize Ollama host configuration

This commit is contained in:
juvdiaz 2026-06-28 00:19:24 -06:00
parent 3c5dfd08c2
commit 61db0ce277
5 changed files with 12 additions and 1 deletions

View File

@ -64,6 +64,9 @@ host, run:
Installer downloads prefer IPv4 by default because some networks have broken or
slow IPv6 paths to `ollama.com`. Override with
`LAB_OLLAMA_INSTALL_CURL_IP_VERSION=` if you want curl's automatic behavior.
The Ryzen integrated GPU is left disabled for Ollama by default; set
`LAB_OLLAMA_IGPU_ENABLE=true` or `debian_pc_ollama_igpu_enable: "true"` when
you intentionally want to test Vulkan/iGPU inference.
If the Debian host cannot reach `ollama.com`, download the matching Linux
tarball from another machine, copy it to Debian, and point `jeannie` at it:

View File

@ -12,6 +12,7 @@ debian_pc_ollama_tarball_file: ""
debian_pc_ollama_host: 0.0.0.0:11434
debian_pc_ollama_models_dir: /data/ollama/models
debian_pc_ollama_default_model: qwen2.5:0.5b
debian_pc_ollama_igpu_enable: "false"
debian_pc_persistent_directories:
- /data/openebs/local/registry

View File

@ -318,6 +318,7 @@
[Service]
Environment="OLLAMA_HOST={{ debian_pc_ollama_host }}"
Environment="OLLAMA_MODELS={{ debian_pc_ollama_models_dir }}"
Environment="OLLAMA_IGPU_ENABLE={{ debian_pc_ollama_igpu_enable }}"
register: debian_pc_ollama_override
when: debian_pc_install_ollama | bool

View File

@ -88,6 +88,7 @@ services:
url: http://192.168.100.73:11434
bind_address: 0.0.0.0:11434
models_dir: /data/ollama/models
igpu_enable: false
rpi_dns:
host: rpi4
pihole_dns_port: 53

View File

@ -60,6 +60,7 @@ mapping = {
"services.local_registry.endpoint": "LAB_REGISTRY_ENDPOINT",
"services.ollama.bind_address": "LAB_OLLAMA_BIND_ADDRESS",
"services.ollama.models_dir": "LAB_OLLAMA_MODELS_DIR",
"services.ollama.igpu_enable": "LAB_OLLAMA_IGPU_ENABLE",
"services.rpi_dns.pihole_web_port": "PIHOLE_WEB_PORT",
"services.rpi_dns.uptime_kuma_port": "UPTIME_KUMA_PORT",
"ai_gateway.provider": "LAB_AI_GATEWAY_PROVIDER",
@ -3393,12 +3394,16 @@ website_translation_model() {
website_ollama_listen() {
local bind_address="${WEBSITE_OLLAMA_BIND_ADDRESS:-${LAB_OLLAMA_BIND_ADDRESS:-0.0.0.0:11434}}"
local models_dir="${LAB_OLLAMA_MODELS_DIR:-/data/ollama/models}"
local igpu_enable="${LAB_OLLAMA_IGPU_ENABLE:-false}"
local dropin_dir="/etc/systemd/system/ollama.service.d"
local dropin_file="${dropin_dir}/homelab.conf"
local waited=0
require_debian_server "website-ollama-listen"
bind_address="${bind_address#http://}"
bind_address="${bind_address#https://}"
if ! systemctl cat ollama.service >/dev/null 2>&1; then
echo "ollama.service was not found on this Debian server." >&2
exit 1
@ -3410,7 +3415,7 @@ website_ollama_listen() {
if id ollama >/dev/null 2>&1; then
sudo chown ollama:ollama "${models_dir}"
fi
printf '[Service]\nEnvironment="OLLAMA_HOST=%s"\nEnvironment="OLLAMA_MODELS=%s"\n' "${bind_address}" "${models_dir}" |
printf '[Service]\nEnvironment="OLLAMA_HOST=%s"\nEnvironment="OLLAMA_MODELS=%s"\nEnvironment="OLLAMA_IGPU_ENABLE=%s"\n' "${bind_address}" "${models_dir}" "${igpu_enable}" |
sudo tee "${dropin_file}" >/dev/null
sudo systemctl daemon-reload
sudo systemctl restart ollama.service