diff --git a/manifests/config.pp b/manifests/config.pp index c416e229..8b0813fe 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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 { @@ -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, + } + } } diff --git a/manifests/init.pp b/manifests/init.pp index 65453abf..e8e97d03 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -387,6 +387,7 @@ $gitlab_workhorse = undef, $user = undef, $web_server = undef, + $enable_backup_cron = false, $custom_hooks = {}, ) inherits ::gitlab::params { @@ -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': } -> @@ -460,7 +462,7 @@ contain gitlab::install contain gitlab::config contain gitlab::service - + create_resources(gitlab::custom_hook, $custom_hooks) }