Puppet Class: bacula::director

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

Overview

Class: bacula::director

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

Parameters:

$sqlvariant
    mysql, pgsql, sqlite3
$max_dir_concur_jobs
    The maximum number of jobs this director will allow running at the same
    time. This means it is a hard limit on the number of what the entire
    infrastructure will do and should be tuned appropriately
$dir_port
    The port the director listens on. Default 9101

Actions:

Install bacula-dir, configure, ensure running

Requires:

Sample Usage:

class { 'bacula::director':
    sqlvariant              => 'mysql',
    max_dir_concur_jobs     => '10',
}

Parameters:

  • sqlvariant (Any)
  • max_dir_concur_jobs (Any)
  • dir_port (Any) (defaults to: '9101')
  • bconsolepassword (Any) (defaults to: sha1($::uniqueid))


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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'modules/bacula/manifests/director.pp', line 26

class bacula::director(
                    $sqlvariant,
                    $max_dir_concur_jobs,
                    $dir_port='9101',
                    $bconsolepassword=sha1($::uniqueid)) {
    # bacula-director depends on bacula-director-sqlvariant
    package { "bacula-director-${sqlvariant}":
        ensure    => installed,
    }

    service { 'bacula-director':
        ensure  => running,
        # The init script bacula-director, the process bacula-dir
        pattern => 'bacula-dir',
        restart => '/usr/sbin/invoke-rc.d bacula-director reload',
        require => Package["bacula-director-${sqlvariant}"],
    }


    File <<| tag == "bacula-client-${::fqdn}" |>>
    File <<| tag == "bacula-storage-${::fqdn}" |>>

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

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

    # We will include this dir and all general options will be here
    file { '/etc/bacula/conf.d':
        ensure  => directory,
        recurse => true,
        force   => true,
        purge   => true,
        mode    => '0444',
        owner   => 'root',
        group   => 'bacula',
        require => Package["bacula-director-${sqlvariant}"],
    }

    # Clients will export their resources here
    file { '/etc/bacula/clients.d':
        ensure  => directory,
        recurse => true,
        force   => true,
        purge   => true,
        mode    => '0444',
        owner   => 'root',
        group   => 'bacula',
        require => Package["bacula-director-${sqlvariant}"],
    }

    file { '/etc/bacula/jobs.d':
        ensure  => directory,
        recurse => true,
        force   => true,
        purge   => true,
        mode    => '0444',
        owner   => 'root',
        group   => 'bacula',
        require => Package["bacula-director-${sqlvariant}"],
    }

    # Populating restore template/migrate jobs
    file { '/etc/bacula/jobs.d/restore-migrate-jobs.conf':
        ensure  => file,
        mode    => '0444',
        owner   => 'root',
        group   => 'bacula',
        require => File['/etc/bacula/jobs.d'],
        content => template('bacula/restore-migrate-jobs.conf.erb'),
    }

    # Storage daemons will export their resources here
    file { '/etc/bacula/storages.d':
        ensure  => directory,
        recurse => true,
        force   => true,
        purge   => true,
        mode    => '0444',
        owner   => 'root',
        group   => 'bacula',
        require => Package["bacula-director-${sqlvariant}"],
    }

    # Exporting configuration for console users
    @@file { '/etc/bacula/bconsole.conf':
        ensure  => present,
        mode    => '0440',
        owner   => 'root',
        group   => 'bacula',
        content => template('bacula/bconsole.conf.erb'),
        tag     => "bacula-console-${::fqdn}",
    }
}