Puppet Class: bacula::client

Inherits:
bacula
Defined in:
manifests/client.pp

Summary

Configure the Bacula File Daemon

Overview

This class installs and configures the File Daemon to backup a client system.

Examples:

class { 'bacula::client': director_name => 'mydirector.example.com' }

Parameters:

  • packages (Array[String])

    A list of packages to install; loaded from hiera

  • services (String)

    A list of services to operate; loaded from hiera

  • default_pool (String)

    The name of the Pool for this FD to use by default

  • default_pool_full (Optional[String])

    The name of the Pool to use for Full jobs

  • default_pool_inc (Optional[String])

    The name of the Pool to use for Incremental jobs

  • default_pool_diff (Optional[String])

    The name of the Pool to use for Differential jobs

  • port (Integer) (defaults to: 9102)

    The listening port for the File Daemon

  • listen_address (Optional[String]) (defaults to: $facts['networking']['ip'])

    The listening INET or INET6 address for File Daemon

  • password (String) (defaults to: 'secret')

    A password to use for communication with this File Daemon

  • max_concurrent_jobs (Integer) (defaults to: 2)

    Bacula FD option for ‘Maximum Concurrent Jobs’

  • director_name (String) (defaults to: $bacula::director_name)

    The hostname of the director for this FD

  • autoprune (Bacula::Yesno) (defaults to: true)

    Bacula FD option for ‘AutoPrune’

  • file_retention (Bacula::Time) (defaults to: '45 days')

    Bacula FD option for ‘File Retention’

  • job_retention (Bacula::Time) (defaults to: '6 months')

    Bacula FD option for ‘Job Retention’

  • client (String) (defaults to: $trusted['certname'])

    The name or address by which to contact this FD

  • address (String) (defaults to: $facts['networking']['fqdn'])

    The listening address for the File Daemon

  • pki_signatures (Optional[Bacula::Yesno]) (defaults to: undef)

    Bacula FD option for ‘PKI Signatures’

  • pki_encryption (Optional[Bacula::Yesno]) (defaults to: undef)

    Bacula FD option for ‘PKI Encryption’

  • pki_keypair (Optional[String]) (defaults to: undef)

    Bacula FD option for ‘PKI Keypair’

  • pki_master_key (Optional[String]) (defaults to: undef)

    Bacula FD option for ‘PKI Master Key’

  • plugin_dir (Optional[String]) (defaults to: undef)

    Bacula FD option for the ‘Plugin Directory’



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

class bacula::client (
  Array[String]           $packages,
  String                  $services,
  String                  $default_pool,
  Optional[String]        $default_pool_full,
  Optional[String]        $default_pool_inc,
  Optional[String]        $default_pool_diff,
  Integer                 $port                = 9102,
  Optional[String]        $listen_address      = $facts['networking']['ip'],
  String                  $password            = 'secret',
  Integer                 $max_concurrent_jobs = 2,
  String                  $director_name       = $bacula::director_name,
  Bacula::Yesno           $autoprune           = true,
  Bacula::Time            $file_retention      = '45 days',
  Bacula::Time            $job_retention       = '6 months',
  String                  $client              = $trusted['certname'],
  String                  $address             = $facts['networking']['fqdn'],
  Optional[Bacula::Yesno] $pki_signatures      = undef,
  Optional[Bacula::Yesno] $pki_encryption      = undef,
  Optional[String]        $pki_keypair         = undef,
  Optional[String]        $pki_master_key      = undef,
  Optional[String]        $plugin_dir          = undef,
) inherits bacula {
  $group    = $bacula::bacula_group
  $conf_dir = $bacula::conf_dir
  $config_file = "${conf_dir}/bacula-fd.conf"

  package { $packages:
    ensure => present,
  }

  service { $services:
    ensure  => running,
    enable  => true,
    require => Package[$packages],
  }

  $use_pki = ($pki_signatures or $pki_encryption) and $pki_keypair

  concat { $config_file:
    owner     => 'root',
    group     => $group,
    mode      => '0640',
    show_diff => false,
    require   => Package[$packages],
    notify    => Service[$services],
  }

  concat::fragment { 'bacula-client-header':
    target  => $config_file,
    content => epp('bacula/bacula-fd-header.epp'),
  }

  bacula::messages { 'Standard-fd':
    daemon   => 'fd',
    director => "${director_name}-dir = all, !skipped, !restored",
    append   => '"/var/log/bacula/bacula-fd.log" = all, !skipped',
  }

  # Tell the director about this client config
  @@bacula::director::client { $client:
    address        => $address,
    port           => $port,
    password       => $password,
    autoprune      => $autoprune,
    file_retention => $file_retention,
    job_retention  => $job_retention,
    tag            => "bacula-${director_name}",
  }
}