X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fbacula%2Fmanifests%2Fclient.pp;h=2918a7938a79c1bc28208192ceff636a4716dce9;hb=3f3b92742679c0dfdf75794f45ef526a133fdc90;hp=4e7592532f4a511954a4cc4ec0a106fe0b5e955b;hpb=2ff27487c60b5ef050465fcc9ad7359bcf3af0af;p=mirror%2Fdsa-puppet.git diff --git a/modules/bacula/manifests/client.pp b/modules/bacula/manifests/client.pp index 4e7592532..2918a7938 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 ! getfromhash($site::nodeinfo, 'not-bacula-client') { - @@bacula::node { $::fqdn: } + @@bacula::node { $::fqdn: + bacula_client_port => $bacula::bacula_client_port, + } } package { ['bacula-fd']: @@ -48,23 +50,30 @@ class bacula::client inherits bacula { require => Package['bacula-fd'], notify => Service['bacula-fd'], } - if $::lsbmajdistrelease != "testing" and $::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 (versioncmp($::lsbmajdistrelease, '9') >= 0 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':