Skip to content

Commit

Permalink
Move backup to its own class
Browse files Browse the repository at this point in the history
This commit moves the backup cronjob to its own class. This ensures that
backup configuration changes do not trigger a Gitlab service restart.

Fixes #204.
  • Loading branch information
baurmatt committed Mar 14, 2018
1 parent 80110ea commit d963ad1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions manifests/backup.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# == Class gitlab::backup
#
# This class is called from gitlab for backup config.
#
class gitlab::backup {
$rake_exec = $::gitlab::rake_exec
$backup_cron_enable = $::gitlab::backup_cron_enable
$backup_cron_minute = $::gitlab::backup_cron_minute
$backup_cron_hour = $::gitlab::backup_cron_hour
if empty($::gitlab::backup_cron_skips) {
$backup_cron_skips = ''
} else {
$_backup_cron_skips = join($::gitlab::backup_cron_skips, ',')
$backup_cron_skips = "SKIP=${_backup_cron_skips}"
}

if $backup_cron_enable {
cron {'gitlab backup':
command => "${rake_exec} gitlab:backup:create CRON=1 ${backup_cron_skips}",
hour => $backup_cron_hour,
minute => $backup_cron_minute,
}
}
}
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,12 @@
class { '::gitlab::install': }
-> class { '::gitlab::config': }
~> class { '::gitlab::service': }
-> class { '::gitlab::backup': }

contain gitlab::install
contain gitlab::config
contain gitlab::service
contain gitlab::backup

$custom_hooks.each |$name, $options| {
gitlab::custom_hook { $name:
Expand Down

0 comments on commit d963ad1

Please sign in to comment.