X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fbacula%2Fmanifests%2Fclient.pp;h=d016e0d0d8b79a424aa4defa8c723b498aceb8aa;hb=932d221f11de1bd4614c669c3f613d4c29213c7a;hp=1ff49df9c253d43be6c78eab9a480ed5b47bca21;hpb=587115788087f4b5c467214be980b202fa4d34f3;p=mirror%2Fdsa-puppet.git diff --git a/modules/bacula/manifests/client.pp b/modules/bacula/manifests/client.pp index 1ff49df9c..d016e0d0d 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,31 @@ 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 (versioncmp($::lsbmajdistrelease, '9') >= 0 and $systemd) { + # old name for the override content + file { '/etc/systemd/system/bacula-fd.service.d/user.conf': + ensure => absent, + } + systemd::override { 'bacula-fd': + content => @(EOT) + [Service] + ExecStart= + ExecStart=/usr/sbin/bacula-fd -c $CONFIG -f -u bacula -k + | EOT } } else { - file { '/etc/apt/preferences.d/dsa-bacula-client': - ensure => absent + file { '/etc/systemd/system/bacula-fd.service.d/user.conf': + ensure => absent, + } + systemd::override { 'bacula-fd': + 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':