Puppet Class: bacula::storage

Defined in:
modules/bacula/manifests/storage.pp

Overview

Class: bacula::storage

This class installs bacula-sd, configures it and ensures that it is running

Parameters:

$director
    The FQDN of the server being our director
$sd_max_concur_jobs
    The maxinum number of jobs this SD is allowd to run simultaneously
$sqlvariant
    mysql, pgsql, sqlite3
$sd_port
    If needed to change the port the sd listens on. Default 9103

Actions:

Install bacula-sd, configure, ensure running
The director password is autogenerated and exported
Exports configuration to bacula-director

Requires:

Sample Usage:

class { 'bacula::storage':
    director            => 'dir.example.com',
    sd_max_concur_jobs  => 5,
    sqlvariant          => 'mysql',
}

Parameters:

  • director (Any)
  • sd_max_concur_jobs (Any)
  • sqlvariant (Any)
  • sd_port (Any) (defaults to: '9103')
  • directorpassword (Any) (defaults to: sha1($::uniqueid))


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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'modules/bacula/manifests/storage.pp', line 29

class bacula::storage(
                    $director,
                    $sd_max_concur_jobs,
                    $sqlvariant,
                    $sd_port='9103',
                    $directorpassword=sha1($::uniqueid)){

    # bacula-sd depends on bacula-sd-sqlvariant. Let's rely on dependencies to
    # install it
    package { "bacula-sd-${sqlvariant}":
        ensure  => installed,
    }

    service { 'bacula-sd':
        ensure  => running,
        require => Package["bacula-sd-${sqlvariant}"],
    }

    file { '/etc/bacula/sd':
        ensure  => directory,
        mode    => '0400',
        owner   => 'bacula',
        group   => 'bacula',
        require => Package["bacula-sd-${sqlvariant}"],
    }

    base::expose_puppet_certs { '/etc/bacula/sd':
        provide_private => true,
        provide_keypair => true,
        user            => 'bacula',
        group           => 'bacula',
        require         => File['/etc/bacula/sd'],
    }

    file { '/etc/bacula/sd-devices.d':
        ensure  => directory,
        recurse => true,
        force   => true,
        purge   => true,
        mode    => '0444',
        owner   => 'root',
        group   => 'bacula',
        require => File['/etc/bacula/bacula-sd.conf'],
    }

    file { '/etc/bacula/bacula-sd.conf':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0400',
        notify  => Service['bacula-sd'],
        content => template('bacula/bacula-sd.conf.erb'),
        require => Package["bacula-sd-${sqlvariant}"],
    }
}