Make bacula-fd run as user bacula on stretch
[mirror/dsa-puppet.git] / modules / bacula / manifests / client.pp
index 0a1d98d..0b2b671 100644 (file)
@@ -2,7 +2,9 @@ class bacula::client inherits bacula {
        @@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,18 @@ class bacula::client inherits bacula {
                require => Package['bacula-fd'],
                notify  => Service['bacula-fd'],
        }
-       if $::lsbmajdistrelease != "testing/unstable" 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,
-               }
-       } else {
-               file { '/etc/apt/preferences.d/dsa-bacula-client':
-                       ensure => absent
-               }
+       file { '/etc/systemd/system/bacula-fd.service.d/user.conf':
+               source  => 'puppet:///modules/bacula/bacula-fd-systemd',
+               mode    => '0400',
+               owner   => root,
+               group   => root,
+               notify  => Service['bacula-fd'],
        }
 
        @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':