download: define utility variables (#13521)

local_release_dir has insufficient nuances, as it needs to handle
several cases,
- where to put downloaded artifacts
- where to search for when installing artifacts
- where to search for when using artifacts (passing them via lookup to
  kubectl stdin for instance)

Furthermore, depending on how the user set up download delegation, the
value we want can be on the host the tasks is executing, on the
delegated hosts, etc.

Define variables on top of local_release_dir for differents contexts,
handling which host context to use depending on `download_delegate`.

Mostly, this boils down to choosing the correct `host` for
hostvars[host]['local_release_dir'].
This commit is contained in:
Max Gautier
2026-09-17 08:59:23 +00:00
committed by GitHub
parent f4eaac3a94
commit bd20622a16
3 changed files with 24 additions and 2 deletions
@@ -1,5 +1,4 @@
---
local_release_dir: /tmp/releases
download_cache_dir: /tmp/kubespray_cache
# If this is true, debug information will be displayed but
@@ -114,7 +114,7 @@ containerd_bin_dir: "{{ bin_dir }}"
etcd_data_dir: /var/lib/etcd
# Where the binaries will be downloaded.
# Note: ensure that you've enough disk space (about 1G)
local_release_dir: "/tmp/releases"
local_release_dir: "{{ default_local_release_dir }}"
# Random shifts for retrying failed ops like pushing/downloading
retry_stagger: 5