From de8315c9a7e51675ac6275a85590b246a6f28adc Mon Sep 17 00:00:00 2001
From: nd <git@notandy.de>
Date: Thu, 26 Nov 2020 09:46:10 +0100
Subject: [PATCH] add support to exclude any part from backup

---
 defaults/main.yml | 2 +-
 tasks/backups.yml | 2 +-
 tasks/gitlab.yml  | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/defaults/main.yml b/defaults/main.yml
index ca01bf8..a7ef42e 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -1,7 +1,7 @@
 gitlab:
   backup:
     enable: True
-    disable_repositories: False
+    disable_part: []
     keep_days: 9
     external_url: 'https://localhost'
     path: '/var/opt/gitlab/backups'
diff --git a/tasks/backups.yml b/tasks/backups.yml
index bf5e7cf..76ed585 100644
--- a/tasks/backups.yml
+++ b/tasks/backups.yml
@@ -1,7 +1,7 @@
 - name: add gitlab-rake backup cronjob
   cron:
     name: gitlab-rake backup
-    job: "/opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1{% if gitlab.backup.disable_repositories %} SKIP=repositories{%endif%}"
+    job: "/opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1{% if gitlab.backup.disable_part %} SKIP={{ gitlab.backup.disable_part|join(',') }}{%endif%}"
     special_time: daily
 - name: add gitlab-tar backup cronjob
   cron:
diff --git a/tasks/gitlab.yml b/tasks/gitlab.yml
index bbfc8d4..0657249 100644
--- a/tasks/gitlab.yml
+++ b/tasks/gitlab.yml
@@ -2,7 +2,6 @@
   apt:
     pkg: gitlab-ce
 
-
 - name: copy gitlab.rb
   template: src=gitlab.rb.j2 dest=/etc/gitlab/gitlab.rb mode=0600 owner=root group=root
   notify:
@@ -12,7 +11,7 @@
   cron:
     name: gitlab registry cleanup
     job: '/opt/gitlab/bin/gitlab-ctl registry-garbage-collect -m 2>/dev/null >/dev/null'
-    special_time: weekly
+    special_time: daily
 
 - name: install python modules needed for group sync
   apt:
-- 
GitLab