3 # @param bacula_db_address hostname of the postgres server for the catalog DB
4 # @param bacula_db_port port of the postgres server for the catalog DB
5 class bacula::director(
6 String $bacula_db_address = 'postgresql-manda-01.debian.org',
7 Integer $bacula_db_port = 5432,
11 'bacula-director-pgsql',
15 ensure => 'installed',
18 service { 'bacula-director':
22 require => Package['bacula-director-pgsql']
24 dsa_systemd::override { 'bacula-director':
31 exec { 'bacula-director reload':
32 path => '/usr/bin:/usr/sbin:/bin:/sbin',
33 command => 'service bacula-director reload',
37 file { '/etc/bacula/conf.d':
44 source => 'puppet:///files/empty/',
45 notify => Exec['bacula-director reload']
48 file { '/etc/bacula/bacula-dir.conf':
49 content => template('bacula/bacula-dir.conf.erb'),
52 require => Package['bacula-director-pgsql'],
53 notify => Exec['bacula-director reload']
56 file { '/etc/bacula/conf.d/empty.conf':
60 require => Package['bacula-director-pgsql'],
61 notify => Exec['bacula-director reload']
66 package { 'bacula-console':
70 file { '/etc/bacula/bconsole.conf':
71 content => template('bacula/bconsole.conf.erb'),
74 require => Package['bacula-console']
77 package { 'python3-psycopg2': ensure => installed }
78 file { '/etc/bacula/scripts/volume-purge-action':
80 source => 'puppet:///modules/bacula/volume-purge-action',
83 file { '/etc/bacula/scripts/volumes-delete-old':
85 source => 'puppet:///modules/bacula/volumes-delete-old',
88 file { '/etc/bacula/storages-list.d':
95 source => 'puppet:///files/empty/',
97 file { '/usr/local/sbin/dsa-bacula-scheduler':
98 source => 'puppet:///modules/bacula/dsa-bacula-scheduler',
102 file { '/etc/cron.d/puppet-bacula-stuff': ensure => absent, }
103 concat::fragment { 'puppet-crontab--bacula-director':
104 target => '/etc/cron.d/puppet-crontab',
106 @daily root chronic /etc/bacula/scripts/volume-purge-action -v
107 @daily root chronic /etc/bacula/scripts/volumes-delete-old -v
108 */3 * * * * root sleep $(( $RANDOM \% 60 )); flock -w 0 -e /usr/local/sbin/dsa-bacula-scheduler /usr/local/sbin/dsa-bacula-scheduler
112 concat { $bacula::bacula_dsa_client_list:
114 concat::fragment { 'bacula-dsa-client-list::header' :
115 target => $bacula::bacula_dsa_client_list,
119 Concat::Fragment <<| tag == $bacula::tag_bacula_dsa_client_list |>>
121 @@ferm::rule::simple { "bacula::director-to-fd::${::fqdn}":
122 tag => "bacula::director-to-fd::${::fqdn}",
123 description => 'Allow bacula-fd from the bacula-director',
124 port => '7', # overridden on collecting
125 saddr => $bacula::public_addresses,
127 @@ferm::rule::simple { "bacula::director-to-storage::${::fqdn}":
128 tag => "bacula::director-to-storage::${::fqdn}",
129 description => 'Allow bacula-storage access from the bacula-director',
130 chain => 'bacula-sd',
131 saddr => $bacula::public_addresses,