Puppet Class: opensearch_dashboards::backups

Defined in:
modules/opensearch_dashboards/manifests/backups.pp

Overview

SPDX-License-Identifier: Apache-2.0

Class: opensearch_dashboards::backups

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')


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
34
35
36
37
38
39
40
# File 'modules/opensearch_dashboards/manifests/backups.pp', line 3

class opensearch_dashboards::backups (
  Wmflib::Ensure $ensure = 'present'
) {
  file { '/usr/local/sbin/run-dashboards-backup':
    ensure => $ensure,
    mode   => '0555',
    owner  => 'root',
    group  => 'root',
    source => 'puppet:///modules/opensearch_dashboards/run-dashboards-backup.sh',
  }

  if ($ensure == 'present') {
    file { '/srv/backups':
      ensure => 'directory',
      mode   => '0755',
      owner  => 'root',
      group  => 'root',
    }

    file { '/srv/backups/opensearch_dashboards':
      ensure  => 'directory',
      mode    => '0755',
      owner   => 'opensearch-dashboards',
      group   => 'opensearch-dashboards',
      require => File['/srv/backups']
    }
  }

  systemd::timer::job { 'run-dashboards-backup':
    ensure          => $ensure,
    description     => 'Dump OpenSearch Dashboards data',
    command         => '/usr/local/sbin/run-dashboards-backup',
    interval        => { 'start' => 'OnCalendar', 'interval' => '*-*-* 00:30:00' },
    user            => 'opensearch-dashboards',
    require         => [File['/usr/local/sbin/run-dashboards-backup'], Package['opensearch-dashboards']],
    logging_enabled => false,
  }
}