X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fbacula%2Fmanifests%2Fclient.pp;h=05234fc9b9316dd440d50f38e822fde02d8c733e;hb=6f2e5fc86e49c12b12eef39fc69e0e810a32c318;hp=40a1eb3534d78fb06716d57ad33f10666192cafc;hpb=5c6179b030da74bbc164eb414883ad8f80dd00a5;p=mirror%2Fdsa-puppet.git diff --git a/modules/bacula/manifests/client.pp b/modules/bacula/manifests/client.pp index 40a1eb353..05234fc9b 100644 --- a/modules/bacula/manifests/client.pp +++ b/modules/bacula/manifests/client.pp @@ -1,8 +1,10 @@ class bacula::client inherits bacula { - @@bacula::storage-per-node { $::fqdn: } + @@bacula::storage_per_node { $::fqdn: } - if $::hostname in [beethoven, berlioz, biber, diabelli, dinis, draghi, geo3, kaufmann, lully, master, picconi, reger, schumann, soler, vento, vieuxtemps, wilder, wolkenstein] { - @@bacula::node { $::fqdn: } + if ! getfromhash($site::nodeinfo, 'not-bacula-client') { + @@bacula::node { $::fqdn: + bacula_client_port => $bacula::bacula_client_port, + } } package { ['bacula-fd']: @@ -18,9 +20,9 @@ class bacula::client inherits bacula { exec { 'bacula-fd restart-when-idle': path => '/usr/bin:/usr/sbin:/bin:/sbin', - command => '(setsid /usr/local/sbin/bacula-idle-restart fd &)', + command => 'sh -c "setsid /usr/local/sbin/bacula-idle-restart fd &"', refreshonly => true, - subscribe => File['/etc/ssl/debian/certs/thishost.crt'], + subscribe => [ File[$bacula_ssl_server_cert], File[$bacula_ssl_client_cert] ], require => File['/usr/local/sbin/bacula-idle-restart'], } @@ -30,7 +32,11 @@ class bacula::client inherits bacula { owner => root, group => bacula, require => Package['bacula-fd'], - notify => Service['bacula-fd'], + notify => Exec['bacula-fd restart-when-idle'], + } + file { '/usr/local/sbin/bacula-backup-dirs': + mode => '0775', + source => 'puppet:///modules/bacula/bacula-backup-dirs', } file { '/usr/local/sbin/postbaculajob': mode => '0775', @@ -44,23 +50,30 @@ class bacula::client inherits bacula { require => Package['bacula-fd'], notify => Service['bacula-fd'], } - if $::lsbmajdistrelease < 7 { - file { '/etc/apt/preferences.d/dsa-bacula-client': - content => template('bacula/apt.preferences.bacula-client.erb'), - mode => '0444', - owner => root, - group => root, + if ($::lsbmajdistrelease >= '9' and $systemd) { + file { '/etc/systemd/system/bacula-fd.service.d': + ensure => directory, + mode => '0755', + owner => root, + group => root, + } + file { '/etc/systemd/system/bacula-fd.service.d/user.conf': + source => 'puppet:///modules/bacula/bacula-fd-systemd', + mode => '0400', + owner => root, + group => root, + notify => Exec['systemctl daemon-reload'], } } else { - file { '/etc/apt/preferences.d/dsa-bacula-client': - ensure => absent + file { '/etc/systemd/system/bacula-fd.service.d/user.conf': + ensure => absent, } } @ferm::rule { 'dsa-bacula-fd-v4': domain => '(ip)', description => 'Allow bacula access from storage and director', - rule => "proto tcp mod state state (NEW) dport (bacula-fd) saddr (${bacula_director_ip}) ACCEPT", + rule => "proto tcp mod state state (NEW) dport (${bacula_client_port}) saddr (${bacula_director_ip}) ACCEPT", } #@ferm::rule { 'dsa-bacula-fd-v6':