# this mostly configures the file daemon, but also firewall rules and
# fragments to sent to the other servers.
class bacula::client(
- Enum['present', 'absent'] $ensure = defined(Class["bacula::not_a_client"]) ? { true => 'absent', default => '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' }
bacula_client_port => $bacula::bacula_client_port,
}
- @@concat::fragment { "bacula-dsa-client-list::$fqdn":
+ @@concat::fragment { "bacula-dsa-client-list::${::fqdn}":
target => $bacula::bacula_dsa_client_list ,
content => @("EOF"),
- ${fqdn}
+ ${::fqdn}
| EOF
tag => $bacula::tag_bacula_dsa_client_list,
}
}
ensure_packages ( [
- 'bacula-fd',
- 'bacula-common',
+ 'bacula-fd',
+ 'bacula-common',
], {
ensure => $package_ensure
})
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => 'sh -c "setsid /usr/local/sbin/bacula-idle-restart fd &"',
refreshonly => true,
- subscribe => [ File[$bacula_ssl_server_cert], File[$bacula_ssl_client_cert] ],
+ subscribe => [ File[$bacula::bacula_ssl_server_cert], File[$bacula::bacula_ssl_client_cert] ],
require => File['/usr/local/sbin/bacula-idle-restart'],
}
notify => Exec['bacula-fd restart-when-idle'],
}
file { '/usr/local/sbin/bacula-backup-dirs':
- ensure => $ensure,
- mode => '0775',
- source => 'puppet:///modules/bacula/bacula-backup-dirs',
+ ensure => $ensure,
+ mode => '0775',
+ source => 'puppet:///modules/bacula/bacula-backup-dirs',
}
file { '/usr/local/sbin/postbaculajob':
- ensure => $ensure,
- mode => '0775',
- source => 'puppet:///modules/bacula/postbaculajob',
+ ensure => $ensure,
+ mode => '0775',
+ source => 'puppet:///modules/bacula/postbaculajob',
}
file { '/etc/default/bacula-fd':
ensure => $ensure,
require => Package['bacula-fd'],
notify => Service['bacula-fd'],
}
- if (versioncmp($::lsbmajdistrelease, '9') >= 0 and $systemd) {
+ if (versioncmp($::lsbmajdistrelease, '9') >= 0 and $facts['systemd']) {
dsa_systemd::override { 'bacula-fd':
content => @(EOT)
[Service]
ferm::rule { 'dsa-bacula-fd':
domain => '(ip ip6)',
description => 'Allow bacula access from storage and director',
- rule => "proto tcp mod state state (NEW) dport (${bacula_client_port}) saddr (${bacula_director_ip_addrs}) ACCEPT",
+ rule => "proto tcp mod state state (NEW) dport (${bacula::bacula_client_port}) saddr (${bacula::bacula_director_ip_addrs}) ACCEPT",
}
}
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => 'sh -c "setsid /usr/local/sbin/bacula-idle-restart sd &"',
refreshonly => true,
- subscribe => File[$bacula_ssl_server_cert],
+ subscribe => File[$bacula::bacula_ssl_server_cert],
require => File['/usr/local/sbin/bacula-idle-restart'],
}
notify => Exec['bacula-sd restart-when-idle']
}
- file { "${bacula_backup_path}/Catalog":
+ file { "${bacula::bacula_backup_path}/Catalog":
ensure => directory,
mode => '0755',
owner => bacula,
# bacula storage for node. This is stored config by a client, collected on the storage
define bacula::storage_per_node() {
- include bacula
+ include bacula
- $bacula_filestor_device = $bacula::bacula_filestor_device
- $bacula_filestor_name = $bacula::bacula_filestor_name
- $bacula_backup_path = $bacula::bacula_backup_path
+ $bacula_filestor_device = $bacula::bacula_filestor_device
+ $bacula_filestor_name = $bacula::bacula_filestor_name
+ $bacula_backup_path = $bacula::bacula_backup_path
- $bacula_client_name = "${name}-fd"
- $client = $name
+ $bacula_client_name = "${name}-fd"
+ $client = $name
- file {
- "/etc/bacula/storage-conf.d/${name}.conf":
- content => template('bacula/storage-per-client.conf.erb'),
- mode => '0440',
- group => bacula,
- notify => Exec['bacula-sd restart-when-idle'],
- ;
- "${bacula_backup_path}/${name}":
- ensure => directory,
- mode => '0755',
- owner => bacula,
- group => bacula,
- ;
- }
+ file {
+ "/etc/bacula/storage-conf.d/${name}.conf":
+ content => template('bacula/storage-per-client.conf.erb'),
+ mode => '0440',
+ group => bacula,
+ notify => Exec['bacula-sd restart-when-idle'],
+ ;
+ "${bacula_backup_path}/${name}":
+ ensure => directory,
+ mode => '0755',
+ owner => bacula,
+ group => bacula,
+ ;
+ }
}