#
# this mostly configures the file daemon, but also firewall rules and
# fragments to sent to the other servers.
#
# this mostly configures the file daemon, but also firewall rules and
# fragments to sent to the other servers.
+#
+# @param director_server director server (address) that controls this client's backups
+# @param storage_server storage server (address) to use for this client
+# @param port_fd port that bacula-fd listens on
+# @param client_name bacula client name for this instance
+# @param ensure present or absent
+ Stdlib::Host $director_server,
+ Stdlib::Host $storage_server,
+ Integer $port_fd = 9102,
+ String $client_name = "${::fqdn}-fd",
Enum['present', 'absent'] $ensure = defined(Class['bacula::not_a_client']) ? { true => 'absent', default => 'present' },
) inherits bacula {
$package_ensure = $ensure ? { 'present' => 'installed', 'absent' => 'purged' }
$service_ensure = $ensure ? { 'present' => 'running', 'absent' => 'stopped' }
$service_enable = $ensure ? { 'present' => true, 'absent' => false }
$reverse_ensure = $ensure ? { 'present' => 'absent', 'absent' => 'present' }
Enum['present', 'absent'] $ensure = defined(Class['bacula::not_a_client']) ? { true => 'absent', default => 'present' },
) inherits bacula {
$package_ensure = $ensure ? { 'present' => 'installed', 'absent' => 'purged' }
$service_ensure = $ensure ? { 'present' => 'running', 'absent' => 'stopped' }
$service_enable = $ensure ? { 'present' => true, 'absent' => false }
$reverse_ensure = $ensure ? { 'present' => 'absent', 'absent' => 'present' }
+ $directory_ensure = $ensure ? { 'present' => 'directory', 'absent' => 'absent' }
+
+ $client = $::fqdn
+
+ file { '/etc/bacula/fd-conf.d':
+ ensure => $directory_ensure,
+ mode => '0755',
+ group => bacula,
+ purge => true,
+ force => true,
+ recurse => true,
+ notify => Exec['bacula-fd restart-when-idle'],
+ }
- @@bacula::node { $::fqdn:
- bacula_client_port => $bacula::bacula_client_port,
+ @@bacula::storage::client { $client:
+ tag => "bacula::to-storage::${storage_server}",
+ client => $client,
+ director_server => $director_server,
| EOF
tag => $bacula::tag_bacula_dsa_client_list,
}
# allow access from director
| EOF
tag => $bacula::tag_bacula_dsa_client_list,
}
# allow access from director
- @@ferm::rule::simple { "bacula::fd-to-storage::${::fqdn}":
- tag => "bacula::director-to-storage::${bacula::bacula_storage_address}",
+ @@ferm::rule::simple { "bacula::fd-to-storage::${client}":
+ tag => "bacula::fd-to-storage::${storage_server}",
description => 'Allow bacula-fd access to the bacula-storage',
chain => 'bacula-sd',
saddr => $bacula::public_addresses,
description => 'Allow bacula-fd access to the bacula-storage',
chain => 'bacula-sd',
saddr => $bacula::public_addresses,
ensure => $service_ensure,
enable => $service_enable,
hasstatus => true,
ensure => $service_ensure,
enable => $service_enable,
hasstatus => true,
}
exec { 'bacula-fd restart-when-idle':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
}
exec { 'bacula-fd restart-when-idle':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
notify => Exec['bacula-fd restart-when-idle'],
}
file { '/usr/local/sbin/bacula-backup-dirs':
notify => Exec['bacula-fd restart-when-idle'],
}
file { '/usr/local/sbin/bacula-backup-dirs':
notify => Service['bacula-fd'],
}
if (versioncmp($::lsbmajdistrelease, '9') >= 0 and $facts['systemd']) {
notify => Service['bacula-fd'],
}
if (versioncmp($::lsbmajdistrelease, '9') >= 0 and $facts['systemd']) {