Puppet Class: bacula::director::config

Inherits:
bacula::params
Defined in:
manifests/director/config.pp

Overview

Class: bacula::director::config

Configure bacula director

Parameters:

  • manage_db (Boolean)
  • export_tag (String)
  • bind_address (String)
  • pwd_for_console (String)
  • pwd_for_monitor (String)
  • sd_host (String)
  • sd_password (String)
  • postgresql_auth_line (Any)
  • bacula_db_password (String)
  • tls_enable (Boolean)
  • default_schedules (Array[String])
  • file_retention (String)
  • job_retention (String)
  • volume_retention (String)
  • max_volume_bytes (String)
  • max_volumes (Integer)
  • email (String)
  • email_from (Optional[String])


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
# File 'manifests/director/config.pp', line 6

class bacula::director::config
(
    Boolean $manage_db,
    String  $export_tag,
    String  $bind_address,
    String  $pwd_for_console,
    String  $pwd_for_monitor,
    String  $sd_host,
    String  $sd_password,
            $postgresql_auth_line,
    String  $bacula_db_password,
    Boolean $tls_enable,
    Array[String] $default_schedules,
    String  $file_retention,
    String  $job_retention,
    String  $volume_retention,
    String  $max_volume_bytes,
    Integer $max_volumes,
    String  $email,
    Optional[String] $email_from

) inherits bacula::params
{


    if $manage_db {
        class { '::postgresql':
            monitor_email => $email,
        }

        class { '::bacula::director::config::postgresql':
            postgresql_auth_line => $postgresql_auth_line,
            bacula_db_password   => $bacula_db_password,
        }
    }

    $l_email_from = $email_from ? {
        undef   => "bacula@${::fqdn}",
        default => $email_from,
    }

    File {
        owner   => $::os::params::adminuser,
        group   => $::bacula::params::bacula_group,
        require => Class['::bacula::director::install'],
        notify  => Class['::bacula::director::service'],
    }

    # Simplistic config file that pulls in configuration fragments
    file { 'bacula-bacula-dir.conf':
        ensure  => present,
        name    => '/etc/bacula/bacula-dir.conf',
        content => template('bacula/bacula-dir.conf.erb'),
        mode    => '0640',
    }

    # Configuration fragment directory; mainly for exported configuration 
    # fragments coming from Filedaemon nodes
    file { 'bacula-bacula-dir.conf.d':
        ensure => directory,
        name   => '/etc/bacula/bacula-dir.conf.d',
        mode   => '0750',
    }

    # Main config file
    file { 'director.conf':
        ensure  => present,
        name    => '/etc/bacula/bacula-dir.conf.d/00director.conf',
        content => template('bacula/director.conf.erb'),
        mode    => '0640',
        require => File['bacula-bacula-dir.conf.d'],
    }

    # Make the delete_catalog_backup script executable
    file { 'bacula-delete_catalog_backup':
        name   => '/etc/bacula/scripts/delete_catalog_backup',
        owner  => $::os::params::adminuser,
        group  => $::os::params::admingroup,
        mode   => '0755',
        notify => undef,
    }

    # Import exported configuration fragments from clients
    File <<| tag == $export_tag |>>
}