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 (Array[String[1]]) (defaults to: [])

    The listening IP addresses for the File Daemon By default, Bacula listen an all IPv4 only, which is equivalent to “‘

    listen_address => [
      '0.0.0.0',
    ],
    

    “‘ Listening on both IPv6 and IPv4 depends on your system configuration of IPv4-mapped IPv6 (RFC 3493): when enabled, the following is enough to listen on both all IPv6 and all IPv4: “`

    listen_address => [
      '::',
    ],
    

    “‘ If IPv4-mapped IPv6 is not used, each address must be indicated separately: “`

    listen_address => [
      '::',
      '0.0.0.0',
    ],
    

    “‘ Indicating both addresses with IPv4-mapped IPv6 enabled will result in Bacula being unable to bind twice to the IPv4 address and fail to start.

  • 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’



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

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,
  Array[String[1]]        $listen_address      = [],
  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}",
  }
}