Skip to content

Commit

Permalink
Add support to manage backup cron job
Browse files Browse the repository at this point in the history
  • Loading branch information
b4ldr committed Aug 18, 2017
1 parent a0cd33d commit ccdcd0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
$gitlab_workhorse = $::gitlab::gitlab_workhorse
$user = $::gitlab::user
$web_server = $::gitlab::web_server
$enable_backup_cron = $::gitlab::enable_backup_cron

# replicate $nginx to $mattermost_nginx if $mattermost_nginx_eq_nginx true
if $mattermost_nginx_eq_nginx {
Expand Down Expand Up @@ -170,4 +171,12 @@
mode => '0644',
}
}

if $enable_backup_cron {
cron {'gitlab backup':
command => '/opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1',
hour => 2,
minute => 0,
}
}
}
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@
$gitlab_workhorse = undef,
$user = undef,
$web_server = undef,
$enable_backup_cron = false,
$custom_hooks = {},
) inherits ::gitlab::params {

Expand Down Expand Up @@ -451,6 +452,7 @@
if $web_server { validate_hash($web_server) }
if $high_availability { validate_hash($high_availability) }
if $manage_accounts { validate_hash($manage_accounts) }
validate_bool($enable_backup_cron)
validate_hash($custom_hooks)

class { '::gitlab::install': } ->
Expand All @@ -460,7 +462,7 @@
contain gitlab::install
contain gitlab::config
contain gitlab::service

create_resources(gitlab::custom_hook, $custom_hooks)

}

0 comments on commit ccdcd0f

Please sign in to comment.