Puppet Class: gitlab::restore

Defined in:
modules/gitlab/manifests/restore.pp

Overview

SPDX-License-Identifier: Apache-2.0 install restore script on secondary gitlab host

Parameters:

  • ensure_restore_script (Wmflib::Ensure) (defaults to: 'present')
  • ensure_restore (Wmflib::Ensure) (defaults to: 'absent')
  • restore_dir_data (Stdlib::Unixpath) (defaults to: '/srv/gitlab-backup')
  • restore_interval (Systemd::Timer::Schedule) (defaults to: {'start' => 'OnCalendar', 'interval' => '*-*-* 01:30:00'})


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'modules/gitlab/manifests/restore.pp', line 3

class gitlab::restore(
    Wmflib::Ensure           $ensure_restore_script = 'present',
    Wmflib::Ensure           $ensure_restore        = 'absent',
    Stdlib::Unixpath         $restore_dir_data      = '/srv/gitlab-backup',
    Systemd::Timer::Schedule $restore_interval      =  {'start' => 'OnCalendar', 'interval' => '*-*-* 01:30:00'},
){

    file {"${restore_dir_data}/gitlab-restore.sh":
        ensure => $ensure_restore_script,
        mode   => '0744' ,
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/gitlab/gitlab-restore.sh';
    }

    file {"${restore_dir_data}/gitlab-restore-v2.sh":
        ensure => $ensure_restore_script,
        mode   => '0744' ,
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/gitlab/gitlab-restore-v2.sh';
    }

    systemd::timer::job { 'backup-restore':
        ensure      => $ensure_restore,
        user        => 'root',
        description => 'GitLab Backup Restore',
        command     => "${restore_dir_data}/gitlab-restore.sh",
        interval    => $restore_interval,
    }
}