From 4e584131407a69f72614a8b632962a439c3ebfdd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Oliger?= <tim@bachaner.fr>
Date: Thu, 7 Nov 2024 03:01:29 +0100
Subject: [PATCH] Add a new crio_root variable in order to store CRI-O data on
 something else than /var/lib (#11692)

---
 roles/container-engine/cri-o/defaults/main.yml      | 2 ++
 roles/container-engine/cri-o/templates/crio.conf.j2 | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/roles/container-engine/cri-o/defaults/main.yml b/roles/container-engine/cri-o/defaults/main.yml
index 5525790d1..5abe24db1 100644
--- a/roles/container-engine/cri-o/defaults/main.yml
+++ b/roles/container-engine/cri-o/defaults/main.yml
@@ -39,6 +39,8 @@ crio_stream_port: "10010"
 
 crio_required_version: "{{ kube_version | regex_replace('^v(?P<major>\\d+).(?P<minor>\\d+).(?P<patch>\\d+)$', '\\g<major>.\\g<minor>') }}"
 
+crio_root: "/var/lib/containers/storage"
+
 # The crio_runtimes variable defines a list of OCI compatible runtimes.
 crio_runtimes:
   - name: crun
diff --git a/roles/container-engine/cri-o/templates/crio.conf.j2 b/roles/container-engine/cri-o/templates/crio.conf.j2
index d20e14dc8..c9ecdca6b 100644
--- a/roles/container-engine/cri-o/templates/crio.conf.j2
+++ b/roles/container-engine/cri-o/templates/crio.conf.j2
@@ -17,7 +17,7 @@
 
 # Path to the "root directory". CRI-O stores all of its data, including
 # containers images, in this directory.
-root = "/var/lib/containers/storage"
+root = "{{ crio_root }}"
 
 # Path to the "run directory". CRI-O stores all of its state in this directory.
 # Read from /etc/containers/storage.conf first so unnecessary here
-- 
GitLab