3 # @param db_address hostname of the postgres server for the catalog DB
4 # @param db_port port of the postgres server for the catalog DB
5 # @param db_name DB name for the catalog DB
6 # @param db_user username for the postgres server for the catalog DB
7 # @param db_sslca SSL CA store for DB access
8 class bacula::director(
11 String $db_name = 'bacula',
12 String $db_user = 'bacula',
13 Optional[String] $db_sslca = undef,
17 'bacula-director-pgsql',
21 ensure => 'installed',
24 service { 'bacula-director':
28 require => Package['bacula-director-pgsql']
30 dsa_systemd::override { 'bacula-director':
37 exec { 'bacula-director reload':
38 path => '/usr/bin:/usr/sbin:/bin:/sbin',
39 command => 'service bacula-director reload',
43 file { '/etc/bacula/conf.d':
50 source => 'puppet:///files/empty/',
51 notify => Exec['bacula-director reload']
54 file { '/etc/bacula/bacula-dir.conf':
55 content => template('bacula/bacula-dir.conf.erb'),
58 require => Package['bacula-director-pgsql'],
59 notify => Exec['bacula-director reload']
62 file { '/etc/bacula/conf.d/empty.conf':
66 require => Package['bacula-director-pgsql'],
67 notify => Exec['bacula-director reload']
70 Bacula::Director::Client<<| tag == "bacula::to-director::${::fqdn}" |>>
72 package { 'bacula-console':
76 file { '/etc/bacula/bconsole.conf':
77 content => template('bacula/bconsole.conf.erb'),
80 require => Package['bacula-console']
83 package { 'python3-psycopg2': ensure => installed }
84 file { '/etc/bacula/scripts/volume-purge-action':
86 source => 'puppet:///modules/bacula/volume-purge-action',
89 file { '/etc/bacula/scripts/volumes-delete-old':
91 source => 'puppet:///modules/bacula/volumes-delete-old',
94 file { '/etc/bacula/storages-list.d':
101 source => 'puppet:///files/empty/',
103 file { '/usr/local/sbin/dsa-bacula-scheduler':
104 source => 'puppet:///modules/bacula/dsa-bacula-scheduler',
108 file { '/etc/cron.d/puppet-bacula-stuff': ensure => absent, }
109 concat::fragment { 'puppet-crontab--bacula-director':
110 target => '/etc/cron.d/puppet-crontab',
112 @daily root chronic /etc/bacula/scripts/volume-purge-action -v
113 @daily root chronic /etc/bacula/scripts/volumes-delete-old -v
114 */3 * * * * root sleep $(( $RANDOM \% 60 )); flock -w 0 -e /usr/local/sbin/dsa-bacula-scheduler /usr/local/sbin/dsa-bacula-scheduler
118 concat { $bacula::bacula_dsa_client_list:
120 concat::fragment { 'bacula-dsa-client-list::header' :
121 target => $bacula::bacula_dsa_client_list,
125 Concat::Fragment <<| tag == $bacula::tag_bacula_dsa_client_list |>>
127 @@ferm::rule::simple { "bacula::director-to-fd::${::fqdn}":
128 tag => "bacula::director-to-fd::${::fqdn}",
129 description => 'Allow bacula-fd from the bacula-director',
130 port => '7', # overridden on collecting
131 saddr => $bacula::public_addresses,
133 @@ferm::rule::simple { "bacula::director-to-storage::${::fqdn}":
134 tag => "bacula::director-to-storage::${::fqdn}",
135 description => 'Allow bacula-storage access from the bacula-director',
136 chain => 'bacula-sd',
137 saddr => $bacula::public_addresses,