Puppet Class: bacula::client

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

Overview

Class: bacula::client

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

Parameters:

$director
    The FQDN of the server being our director
$catalog
    Which bacula catalog will be used for this client
$file_retention
    How much time the catalog will hold data about files
$job_retention
    How much time the catalog will hold data about jobs
$fd_port
    If needed to change the port the fd listens on. Default 9102
$client_version
    Package version to install, can be either 9 (for 9.7) or 15 (for 15.0)
    for Debian 13. Debian 12 or lower will always install bacula-fd 9.7.

Actions:

Install bacula-fd, configure, ensure running
The director password is autogenerated and exported
Exports configuration to bacula-director
Defines a virtual resource for a bpipe mysql plugin

Requires:

Sample Usage:

class { 'bacula::client':
    director    => 'dir.example.com',
}

Parameters:

  • director (Any)
  • catalog (Any)
  • file_retention (Any)
  • job_retention (Any)
  • directorpassword (Any)
  • fdport (Any) (defaults to: '9102')
  • client_version (Any) (defaults to: 15)


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
# File 'modules/bacula/manifests/client.pp', line 32

class bacula::client(
                    $director,
                    $catalog,
                    $file_retention,
                    $job_retention,
                    $directorpassword,
                    $fdport='9102',
                    $client_version=15,
) {

    if debian::codename::eq('trixie') and $client_version == 9 {
        apt::package_from_component { 'bacula-trixie':
            component => 'component/bacula9',
            packages  => ['bacula-fd', 'bacula-common'],
        }
    } else {
        package { 'bacula-fd':
            ensure => installed,
        }
    }

    service { 'bacula-fd':
        ensure  => running,
        require => Package['bacula-fd'],
    }

    # TODO: consider using profile::pki::get_cert
    puppet::expose_agent_certs { '/etc/bacula':
        provide_private => true,
        provide_keypair => true,
        user            => 'bacula',
        group           => 'bacula',
        require         => Package['bacula-fd'],
        notify          => Service['bacula-fd'],
    }

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

    if wmflib::have_puppetdb() {
        # We export oufself to the director
        @@file { "/etc/bacula/clients.d/${::fqdn}.conf":
            ensure  => present,
            owner   => 'root',
            group   => 'bacula',
            mode    => '0440',
            content => template('bacula/bacula-client.erb'),
            notify  => Service['bacula-director'],
            tag     => "bacula-client-${director}",
        }
    }
}