[Solved] Configure different fileset for Bareos client

Hi all,

The Bareos client configuration is automatically generated for each client created on UCS PDC as a Computer. (Even the ones that Bareos Backup job is not enabled.)

Now I have cases where I want to assign a different fileset to a client. I have created a fileset configuration at /etc/bareos/bareos-dir.d/fileset and when I change the client auto-generated file manually this fileset is applied.
But the auto-generation reverts my changes.

So my question is how to adapt so I don’t end up with a manual client config that is used and an automatic one that shall not be used?

Is the only way to create manual jobs per client that overwrite this?


I have solved this myself by adding an extended attribute in LDAP and extendings this script by 2 lines:

*** /usr/lib/univention-directory-listener/system/univention-bareos.py.orig	2018-05-18 12:37:10.405091288 +0200
--- /usr/lib/univention-directory-listener/system/univention-bareos.py	2018-05-18 12:14:49.393301640 +0200
*** 88,93 ****
--- 88,96 ----
          if 'univentionWindows' in entry['objectClass']:
+         if entry.has_key('univentionFreeAttribute2'):
+                 client_type=entry['univentionFreeAttribute2'][0]
          if delete==True:

I had to use the command-line to add some of the modules since they were not visible in the web interface.

udm settings/extended_attribute create --position "cn=bareos,cn=custom attributes,cn=univention,dc=domain,dc=local" \
--set name=baresos-clienttype \
--set CLIName=bareos-clienttype \
--set shortDescription='client type' \
--set translationShortDescription='"de_DE" "Client Typ"' \
--set longDescription='template that will be used to generate client configuration' \
--set translationLongDescription='"de_DE" "Vorlage, die zur Generierung der Client Konfiguration verwendet wird."' \
--set module='computers/windows' \
--set module='computers/domaincontroller_master' \
--set module='computers/domaincontroller_backup' \
--set module='computers/domaincontroller_slave' \
--set module='computers/memberserver' \
--set module='computers/linux' \
--set module='computers/ipmanagedclient' \
--set module='computers/ubuntu' \
--set module='computers/macos' \
--set objectClass=univentionFreeAttributes \
--set ldapMapping=univentionFreeAttribute2 \
--set tabPosition=3 \
--set tabName='Bareos Backup' \
--set syntax='string' \
--set notEditable=0 \
--set mayChange=1 \
--set copyable=1

Next I created a new Bareos client template domaincontroller.template:

Client {
  Name = "${client_name}-fd"
  Address = "${client_name}"
  Password = "${password}"

Job {
  Name = "Backup-${client_name}"
  Client = "${client_name}-fd"
  JobDefs = "DefaultJob"
  FileSet = "UcsDomainController"
  #Schedule = "WeeklyCycle"
  Enabled = "${enable}"

Now I could edit a computer entry via UDM Web to set the client type to domaincontroller.

If the client type does not exist as template file you will find a message IOError: [Errno 2] No such file or directory in /var/log/univention/listener.log.

Would be happy if that can be integrated in the standard Bareos Integration.

1 Like