Use systemd::override instead of manual bacula-fd.service.d/user.conf
[mirror/dsa-puppet.git] / modules / bacula / manifests / client.pp
index 34e2b64..d016e0d 100644 (file)
@@ -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,6 +50,26 @@ class bacula::client inherits bacula {
                require => Package['bacula-fd'],
                notify  => Service['bacula-fd'],
        }
+       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/systemd/system/bacula-fd.service.d/user.conf':
+                       ensure  => absent,
+               }
+               systemd::override { 'bacula-fd':
+                       ensure  => absent,
+               }
+       }
 
        @ferm::rule { 'dsa-bacula-fd-v4':
                domain      => '(ip)',