Puppet Class: snapshot::dumps::dirs

Defined in:
modules/snapshot/manifests/dumps/dirs.pp

Overview

Parameters:

  • user (Any) (defaults to: undef)
  • xmldumpsmount (Any) (defaults to: undef)
  • xmldumpspublicdir (Any) (defaults to: undef)
  • xmldumpsprivatedir (Any) (defaults to: undef)
  • dumpstempdir (Any) (defaults to: undef)
  • cronsdir (Any) (defaults to: undef)
  • apachedir (Any) (defaults to: undef)


1
2
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'modules/snapshot/manifests/dumps/dirs.pp', line 1

class snapshot::dumps::dirs(
    $user = undef,
    $xmldumpsmount = undef,
    $xmldumpspublicdir = undef,
    $xmldumpsprivatedir = undef,
    $dumpstempdir = undef,
    $cronsdir = undef,
    $apachedir = undef,
) {
    # need to create and manage these, and have them
    # available for a shell script that sets vars with
    # their values for inclusion by other scripts
    $dumpsdir = '/etc/dumps'
    file { $dumpsdir:
      ensure => 'directory',
      mode   => '0755',
      owner  => 'root',
      group  => 'root',
    }

    $confsdir = "${dumpsdir}/confs"
    $dblistsdir = "${dumpsdir}/dblists"
    $stagesdir = "${dumpsdir}/stages"
    $templsdir = "${dumpsdir}/templs"
    file { [ $confsdir, $dblistsdir, $stagesdir,
      $templsdir ]:

      ensure => 'directory',
      mode   => '0755',
      owner  => 'root',
      group  => 'root',
    }

    # dir will be written in by the user
    $cachedir = "${dumpsdir}/cache"
    file { $cachedir:
      ensure => 'directory',
      mode   => '0755',
      owner  => $user,
      group  => 'root',
    }

    # need these only for the shell script that sets
    # vars with their values for other scripts
    $repodir = '/srv/deployment/dumps/dumps/xmldumps-backup'

    # here's that script; it gets sourced by
    # various cron jobs so they know where to
    # write output, where to find dump scripts, etc.
    file { '/usr/local/etc/set_dump_dirs.sh':
        ensure  => 'present',
        path    => '/usr/local/etc/set_dump_dirs.sh',
        mode    => '0755',
        owner   => 'root',
        group   => 'root',
        content => template('snapshot/set_dump_dirs.sh.erb'),
    }
}