From 2ffe64411fc5b39d5a6a5dce483f4c05675a600b Mon Sep 17 00:00:00 2001
From: psy <psy@darmstadt.ccc.de>
Date: Thu, 10 Dec 2020 16:45:46 +0100
Subject: [PATCH] add config option to change registry path

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

diff --git a/README.md b/README.md
index 3f3ebcd..8597634 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,9 @@ external_url: 'https://localhost'
 # external url for gitlab pages, set to Null to disable
 pages_external_url: ~
 
+# alternative storage path for registry, set to Null to disable
+registry_path: ~
+
 # external url for the container registry, set to Null to disable
 registry_external_url: ~
 
diff --git a/defaults/main.yml b/defaults/main.yml
index a7ef42e..07f9ac5 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -6,6 +6,7 @@ gitlab:
     external_url: 'https://localhost'
     path: '/var/opt/gitlab/backups'
   pages_external_url: ~
+  registry_path: ~
   registry_external_url: ~
   gitlab_ssh_host: 'localhost'
   gitlab_shell_ssh_port: 22
diff --git a/templates/gitlab.rb.j2 b/templates/gitlab.rb.j2
index cb14f3f..e8e9cb1 100644
--- a/templates/gitlab.rb.j2
+++ b/templates/gitlab.rb.j2
@@ -651,6 +651,9 @@ gitlab_rails['registry_enabled'] = true
 # gitlab_rails['registry_port'] = "5000"
 # gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
 
+{% if gitlab.registry_path %}
+gitlab_rails['registry_path'] = "{{ gitlab.registry_path }}"
+
 # Notification secret, it's used to authenticate notification requests to GitLab application
 # You only need to change this when you use external Registry service, otherwise
 # it will be taken directly from notification settings of your Registry
-- 
GitLab