From 9ad6b1b66e387a2f58ce32f6a663b1f42f6b3be3 Mon Sep 17 00:00:00 2001
From: nd <git@notandy.de>
Date: Thu, 23 Dec 2021 22:44:24 +0100
Subject: [PATCH] allow to override artifacts_path

---
 README.md              | 5 ++++-
 defaults/main.yml      | 1 +
 templates/gitlab.rb.j2 | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 31361df..c8ad25c 100644
--- a/README.md
+++ b/README.md
@@ -43,9 +43,12 @@ pages_listen_proxy: ''
 # external url for the container registry, set to Null to disable
 registry_external_url: ~
 
-# alternative storage path for registry, only considere when registry_external_url is set. set to Null to use defaults
+# alternative storage path for registry, only considere when registry_external_url is set. Set to Null to use defaults
 registry_path: ~
 
+# alternative storage path for artifacts. Set to Null to use defaults
+artifacts_path: ~
+
 # external ssh host, can be different from external_url
 gitlab_ssh_host: 'localhost'
 
diff --git a/defaults/main.yml b/defaults/main.yml
index 12b928f..15f8cd9 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -11,6 +11,7 @@ gitlab:
   pages_listen_proxy: 'localhost:11181'
   registry_path: ~
   registry_external_url: ~
+  artifacts_path: ~
   gitlab_ssh_host: 'localhost'
   gitlab_shell_ssh_port: 22
   initial_root_password: "{{ lookup('password', '/dev/null length=64') }}"
diff --git a/templates/gitlab.rb.j2 b/templates/gitlab.rb.j2
index 00d804f..8a4c510 100644
--- a/templates/gitlab.rb.j2
+++ b/templates/gitlab.rb.j2
@@ -231,6 +231,9 @@ gitlab_rails['gitlab_username_changing_enabled'] = false
 ### Job Artifacts
 # gitlab_rails['artifacts_enabled'] = true
 # gitlab_rails['artifacts_path'] = "/var/opt/gitlab/gitlab-rails/shared/artifacts"
+{% if gitlab.artifacts_path %}
+gitlab_rails['artifacts_path'] = "{{ gitlab.artifacts_path }}"
+{% endif %}
 ####! Job artifacts Object Store
 ####! Docs: https://docs.gitlab.com/ee/administration/job_artifacts.html#using-object-storage
 # gitlab_rails['artifacts_object_store_enabled'] = false
-- 
GitLab